Jump to content

Custom Hitid+numhit


deecue

Recommended Posts

hey all,

been a while since I've been by and i terribly miss the community.. feels good to get back in to it after so long. so i've got a few questions and I'm hoping someone can help..

i'm wanting to create a custom attribute that uses the hitid as an index + the number of times it hits that particular object. and i want the numhit to begin at the time it begins colliding with that particular object and not at the first collision of any object.

so let's say i have 3 objects and particles are bouncing all over them. then i want a particular event/group/anything to occur during the first collision of object 3. the numhit of each is different per particle as each one could hit the first 2 objects 3 times, 8 times, or N times. so i can't really just use the standard numhit+hitide. i want this attribute to equal 301 on the first collision with object 3. the traditional sim numhit could equal 12, 5, or 1 but i want it to be the first of that particular object. ie 204 would be the 4th hit of object 2 and so on.

i definitely don't have to build the system this way, it's just how i'm viewing inside my head and can't wrap around an idea to create it. if theres other methods that would achieve the same results, then i'm all for it. I just basically want a collision counter for particles that's independent for each object it collides with.

thanks all,

dave

Link to comment
Share on other sites

yea, no kidding.. and he came up with the answer in seconds.. :)

just create a collision group that's not preserved and then an attribute pop following it. set the attribute to only source that collision group and make the value $ATTR+1. so the collision group will contain points when there's a hit (1) and won't when there's not (0).. keep adding them iteratively and you got yourself a custom numhit. easy peasy.. now it makes me wonder why i couldn't think of it.. :rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...