- Home /
Stabilising particle motion in rotating world
Hello. I'm struggling to do something that seems fairly simple.
I have two things that spit particles at each other at a constant rate. I move the particles like this:
particles[i].position = Vector3.MoveTowards(particles[i].position, targetObj.transform.position, particleSpeed);
They should move in a straight line:
But when I rotate the objects via their common parent node, the particles curve:
I don't want them to curve, I want them to move in a straight line no matter how fast the world is spinning. Is this possible? What am I missing? Thanks!
Answer by thef1chesser · Oct 28, 2013 at 09:59 AM
Well for starters on screen you see exactly what you coded.
The particles start of in a certain direction and because you move the objects, the particles get a new destination. To go towards this new location they curve.
Now how to solve this.
If you really want to move them in a straight line.
Don't move the objects, move the world (or camera).
When you say 'move the world', what do you mean exactly? Right now, I'm rotating a common parent (the world), which then moves the objects and particle emitters.
to give the result you want i think rotating the camera over the z axis will give you the result you need.