So I needed to constrain a locator to a moving particle so that I can bake the translation of the particle into it and get some animation curves. So far, I found this information in a previous thread:
—— start of previous message
Parv
Frequenter Jul '12
Well…
This works with regular particles so not sure if it will work with nParticles or not.
// declare a float array variable and store the world position values of a particle in it
float $position[] : getParticleAttr worldPosition -at particleShape1.pt[1];
//assign the stored values to the Translate X Y Z attributes of the locator
locator1.tx = $position[0];
locator1.ty = $position[1];
locator1.tz = $position[2];
// I hope it helps
—— end of precious message
However, I tried it and it gives me a ton of syntax errors. Needed to know if anyone knows what I could be doing wrong.
I tied it with particleShape1.pt[0] as well as with particle1.pt[0] and particle1.pt[1]. I also tried it with both nParticles and regular particles.
But I get syntax errors for every line almost. Any help would be appreciated to get this to work or another way to constrain the locator and make this work.
Thanks in advance,
Ken