Particle Instancers Rotation Ramp


#1

Hi, I am required to make a container and gold coins start dropping in and fill the container.
I’ve created an emitter and used particle instancers to replace the particles with my coin shape polygon.

I inserted this expression into the dynamic attribute i created, “rotateMe”

(Creation)
seed(nParticleShape1.particleId);
float $rotRand=rand(180);
nParticleShape1.rotateMe=<<$rotRand,$rotRand,$rotRand>>;

(Runtime before dynamics)
nParticleShape1.rotateMe +=20

now the problem is the coins wont stop rotating, I want the coins to stop rotating when it hits the ground and im a total newbie in scripting. Can anyone help me out?

Thank you. :slight_smile:


#2

Instead of expression calculate the rotation of the nParticles. You can do that by checking the thick box “Compute Rotation” under rotation tab.After that plug the newly created rotationPP to the rotation of the particle instancer. That will make them rotate properly when they hit the ground plane.

In your example your particles wont stop rotating because you dont have a condition.
nParticleShape1.rotateMe +=20-> rotate every frame by 20.
If you want to have them rotating while falling you will need to add some conditions :>.

Hope this helps if not sry for wasting your time.


#3

Thank you very much. I will give it a try!
And no worries, no time is wasted. Even if it doesn’t work for me, at least I will learn something new. Really appreciate your help. Thank you again! :slight_smile:


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.