So I am spawning a simple beam emitter with BeamTargetType as BEAM_OffsetAsAbsolute and setting the end offset as HitLocation got from weapon's TraceFire function. This works fine in offline mode, but in online mode the end offset is always Vector(0, 0, 0). I can't figure out why it is not working.
This is how I spawn the beam called from TraceFire function:
Code: Select all
simulated function SpawnSniperBeam(vector Start, vector End)
{
local SniperBeamEffect beamEffect;
if(Pawn(Owner) == None)
return;
beamEffect = Spawn(Class'SniperBeamEffect ', Pawn(Owner),, Start, rotator(End - Start));
if(beamEffect != None)
{
//Array_Insert(beamEffect.BeamTarget, 0, 1);
beamEffect.BeamTarget[0].Offset = End;
}
}
Code: Select all
class SniperBeamEffect extends XBeamEmitter;
defaultproperties
{
Segments=10,
MaxParticles=1,
TurnRate=100
BeamTargetType=BEAM_OffsetAsAbsolute,
LifetimeRange=(Min=1.00,Max=1.00),
ParticleStyle=STY_Translucent
ParticleColor=(X=(Min=1.000000,Max=1.000000),Y=(Min=0.300000,Max=0.300000),Z=(Min=0.000000,Max=0.000000))
ParticleTextures=Texture'FX_Beam'
FadeInTime=0.05,
FadeOutTime=0.80,
StartingScale=(Min=1.50,Max=1.50),
bUseRelativeLocation=True,
RemoteRole=ROLE_SimulatedProxy,
LifeSpan=1.00,
bSkipActorReplication=False,
TextureUV(0)=0.00
TextureUV(1)=0.00
TextureUV(2)=0.00
TextureUV(3)=1.00
}