Stop a ball from rotating
jon2s
Member Posts: 40
I've been messing with all sorts of things to keep a ball from rolling forever.
My setup: Gravity is in use. If a ball falls down to the "ground" and does not come into contact with anything else, it stops perfectly. If a ball falls down and comes into contact with something else, it nearly always continues to roll. Even if it falls between 2 boxes, it will roll between those 2 boxes forever. Barely even moving. I've tried applying drag, increasing the friction, density, changing velocity to 0 for both x and y, setting rotation to 0, moving the ball somewhere else. Nothing seems to work. Any suggestions?
Thanks,
Jon
My setup: Gravity is in use. If a ball falls down to the "ground" and does not come into contact with anything else, it stops perfectly. If a ball falls down and comes into contact with something else, it nearly always continues to roll. Even if it falls between 2 boxes, it will roll between those 2 boxes forever. Barely even moving. I've tried applying drag, increasing the friction, density, changing velocity to 0 for both x and y, setting rotation to 0, moving the ball somewhere else. Nothing seems to work. Any suggestions?
Thanks,
Jon
Comments
If angular velocity < 1 (or some other arbitrary amount. Test to find what you like)
set angular velocity = 0
Edit: Oop. Initially, I just scanned your initial post. After more thorough reading, sounds like you are still getting rotation while even standing in place...so yeah, angular velocity being zeroed out similar to what Eastbound suggested should work.
I will try this too.
Thanks guys!
After a few hours of banging my head I made the actor spawn an identical unmovable actor. A bit of a side step but it worked and gave me more FPS.
Although destroying and spawning takes FPS from the game, unmovable actors are much more efficient than movable ones.