• This function is Server how do I Client?
    2 replies, posted
I want to create a particle effect when my projectile bumps into something. That happens they (perhaps hacky?) way I've managed, but it's not always in the right position. ENTITY/PhysicsCollide only runs on SERVER. If it was shared this wouldn't be an issue, but I can understand why it isn't. So what I tried to do is this: local fwdVec = Vector(0,0,0) local fxPosi = Vector(0,0,0) function ENT:Think() fwdVec = self:GetVelocity():GetNormalized() local rayTrace = util.TraceLine( { start = self:GetPos(), endpos = self:GetPos() + fwdVec * 4000, filter = function( ent ) if ( ent == self.Owner ) or ( ent == self ) then return false else return true end end } ) if self:GetBoltStyle(69) < 0 then ParticleEffect( "ddl_Raios_Impact_Pistol01", fxPosi, rayTrace.HitNormal:Angle(), self ) self:SetBoltStyle(69) else fxPosi = rayTrace.HitPos end If the distance between my face and something I shot at is so short that the projectile collides the frame after I fire the weapon, the effect will spawn where I fired the gun from. I want the effect to spawn where the projectile hit. And I really think Thinking is not the right way to do this. So, what is the right way?
ParticleEffect and ParticleEffectAttach are shared? It should work serverside.
It doesn't seem to be, though. I'm running a 4 player server to test this, haven't tested singleplayer.
Sorry, you need to Log In to post a reply to this thread.