instancer doesn't pick random object , it picks always first object.


#1

hi,

i have a question .how can i randomize instance object for particles. but these particle created via particle collision event, when my main particle collide with a wall they split into 15 particles and original one dies. i created per particle attirbute for splitted particles and create random selection atribute (to pick different object in instancer object list) and select that attribute from instancer object index dropdown list.it always pick the first object. i try runtime before dynamics, after dynamics or creation always same.
any solution?


#2

Hi stretched.

You may insert a runtime expression in the “Runtime before dynamics” like
“particleShape2.randIns = particleShape2.particleId%4;”
where “randIns” is the custom per particle attribute name for the object index with, in this example, 4 geos in the list.

Because the new split particles are emitted into an existing particle with the emit command, the creation expression won’t work - correct me if I’m wrong.

So you need something static like the particleId to assign your objects in the “Runtime before dynamics”. If you like it more random, you may use the particleId for the seed:

seed(id);
randIns = floor(rand(0,4));

Hope that helps.
Cheers


#3

thank you. resolved.