Applying force on dynamics with statics
Posted: Tue Jul 14, 2020 12:36 am
Hello! Awesome library =)
I have a simple simulation with a static floor, static box, and dynamic sphere. I can apply linear force on the sphere in the plane of the floor, and it moves around exactly as expected. Unexpected, however, it what happens if the sphere is up against the box and I apply force in the box's direction: the sphere slowly enters the box instead of being blocked by it.
This seems solved by the character controller demo: moving via the TargetVelocity vector instead of directly applying force correctly stops the sphere right at the edge of the box. I was hoping to avoid the lines of code and required understanding of CharacterControllers.cs though. (Adding something like the sphere getting 'kicked' by a magical foot that is separate from normal character movement control seems complicated w/ CharacterControllers.)
I'm generally looking for a solution with the library that allows me to apply arbitrary force to dynamics in the simulation that will respect the rigid bodies of other dynamics and statics. Any chance someone has a pointer here on the simplest way to achieve this?
Thanks very much in advance!
-senlaar
I have a simple simulation with a static floor, static box, and dynamic sphere. I can apply linear force on the sphere in the plane of the floor, and it moves around exactly as expected. Unexpected, however, it what happens if the sphere is up against the box and I apply force in the box's direction: the sphere slowly enters the box instead of being blocked by it.
This seems solved by the character controller demo: moving via the TargetVelocity vector instead of directly applying force correctly stops the sphere right at the edge of the box. I was hoping to avoid the lines of code and required understanding of CharacterControllers.cs though. (Adding something like the sphere getting 'kicked' by a magical foot that is separate from normal character movement control seems complicated w/ CharacterControllers.)
I'm generally looking for a solution with the library that allows me to apply arbitrary force to dynamics in the simulation that will respect the rigid bodies of other dynamics and statics. Any chance someone has a pointer here on the simplest way to achieve this?
Thanks very much in advance!
-senlaar