I have a decorative element that attaches to a player. It is supposed to stay positionally with the player, but remain at 0,0,0 rotation. It works fine offline, but the minute I test it online it rotates forward 90 degrees in pitch. THe physics state is PHYS_Trailer, if I change it to any other physics state, it is COMPLETELY invisible online. This subclasses effect. I tried subclassing Projectile, exact same issues.
Code:
var rotator NoRot;
var() float TimeLeft;
var(Sounds) sound MiscSound;
function PostBeginPlay()
{
SetTimer(0.1, True);
SetLocation(Owner.Location);
SetRotation(NoRot);
DrawScale = Pawn(Owner).DrawScale;
if(DrawScale <= 0.0)
DrawScale = 1.0;
NoRot.Pitch = 0;
NoRot.Yaw = 0;
NoRot.Roll = 0;
}
simulated function timer()
{
TimeLeft -= 0.1;
if(Pawn(Owner).Health <= 0 || TimeLeft <= 0.0)
{
Pawn(Owner).GroundSpeed = Pawn(Owner).Default.GroundSpeed;
Pawn(Owner).AirSpeed = Pawn(Owner).Default.AirSpeed;
Pawn(Owner).WaterSpeed = Pawn(Owner).Default.WaterSpeed;
Pawn(Owner).Buoyancy = Pawn(Owner).Default.Buoyancy;
Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ;
Destroy();
}
else
{
SetLocation(Owner.Location);
SetRotation(NoRot);
DrawScale = Pawn(Owner).DrawScale;
if(DrawScale <= 0.0)
DrawScale = 1.0;
}
}
simulated function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)
{
local FrozenShatter S;
Pawn(Owner).TakeDamage(Damage/3, Instigator, HitLocation, Momentum, DamageType);
S = Spawn(class'RajMutators2.FrozenShatter',,,HitLocation);
S.RemoteRole = Role_SimulatedProxy;
S.Drawscale = 1.0;
}