• Movement basic relative to the particle angle
    2 replies, posted
Hello. I've recently been playing around with particles and I ran into a problem. I made a particle that flies upwards (Used movement basic operator with values = 0, 0, 1000). I spawn it using this script: ParticleEffect("firetest", ply:GetPos(), ply:GetAngles()+Angle(90,0,0),ply) I want to shoot particles in front of the player, but no matter what I put here, my particle flies into air. Is there any way to make the movement basic operator relative to the angles of the player?
Hello! In your movement code, get a direction of player’s view: ply:GetEyeTrace().Normal This is a normalized vector - its length is equal to 1. You can then multiply it by some number to make the particle go faster. Also, you should consider rotating the angle you spawn your particle with instead of adding another angle. So your code becomes like this: local ang = ply:GetAngles() ang:RotateAroundAxis(ply:GetAngles():Up(), 90) ParticleEffect(“firetest”, ply:GetPos(), ang) Hope this helps.
I found out that my script actually works. It was the problem with the particle. I think that movement basic is relative to the world, but using position within sphere random operator's speed_in_local_coordinate_system to generate force makes it rotatable. But thanks for help anyways.
Sorry, you need to Log In to post a reply to this thread.