Thx a million man ! It works now perfectly. Don't know why it didn't with my last attempt, but now it's perfect. Here is the code i use which can be useful for some people since it only has the basis.
There may have some un perfect things but it works very well Thx again for the solution !
Code:
class PulseProjectile extends Projectile;
var xEmitter Trail;
var vector InitialLocation;
replication
{
reliable if(Role==ROLE_Authority)
InitialLocation;
}
simulated function Destroyed()
{
if ( Trail != None )
Trail.mRegen = false;
Super.Destroyed();
}
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
Velocity = Vector(Rotation) * Speed;
InitialLocation = Location;
if(Level.bDropDetail)
{
bDynamicLight = false;
LightType = LT_None;
}
}
simulated function PostNetBeginPlay()
{
if(Level.NetMode != NM_DedicatedServer )
Trail = Spawn(class'At_PulseTrail', self,, InitialLocation);
}
simulated function Explode(vector HitLocation, vector HitNormal)
{
PlaySound(Sound'WeaponSounds.BioRifle.BioRifleGoo2');
Acceleration = vect(0, 0, 0);
Velocity = vect(0, 0, 0);
SetDrawType(DT_None);
Destroy();
}
simulated function ProcessTouch (Actor Other, vector HitLocation)
{
local Vector X, RefNormal, RefDir;
if (Other == Instigator) return;
if (Other == Owner) return;
if (Other.IsA('xPawn') && xPawn(Other).CheckReflect(HitLocation, RefNormal, Damage*0.25))
{
if (Role == ROLE_Authority)
{
X = Normal(Velocity);
RefDir = X - 2.0*RefNormal*(X dot RefNormal);
Spawn(Class, Other,, HitLocation+RefDir*20, Rotator(RefDir));
}
Destroy();
}
else if ( !Other.IsA('Projectile') || Other.bProjTarget )
{
if ( Role == ROLE_Authority )
Other.TakeDamage(Damage * 1.0,Instigator,HitLocation,MomentumTransfer* Normal(Velocity),MyDamageType);
Explode(HitLocation, vect(0,0,1));
}
}
defaultproperties
{
ExplosionDecal=class'LinkBoltScorch'
Damage=25
MyDamageType=class'DamTypeLinkPlasma'
Speed=4000
MaxSpeed=4500
MomentumTransfer=25000
ExploWallOut=0
LifeSpan=5
AmbientGlow=217
bDynamicLight=true
LightType=LT_Steady
LightEffect=LE_QuadraticNonIncidence
LightBrightness=255
LightHue=165
LightSaturation=25
LightRadius=10
bFixedRotationDir=True
DrawType=DT_StaticMesh
StaticMesh=StaticMesh'At_EffectsMeshs.PulsePrimaryProj'
DrawScale=2.0
Style=STY_Additive
AmbientSound=Sound'WeaponSounds.ShockRifle.LinkGunProjectile'
SoundRadius=50
SoundVolume=150
ForceType=FT_Constant
ForceScale=5.0
ForceRadius=30.0
PrePivot=(X=10)
}
There may have some un perfect things but it works very well Thx again for the solution !