- Home /
Ball moving in tube with rigidbody
Lets say you have a sphere(rigidbody, sphere collider) inside a tube(mesh collider). I want a ball to move in the direction of tube always by applying force on rigidbody.
My purpose is to simulate the circular gravity, so that ball can fall down back obviously in circular motion. This was the approach I was using to simulate fake circular gravity.
How can i check which direction of force has to be applied to continue motion following the path of the tube with addforce?
Image is attached
Answer by GeroNL · Mar 09, 2021 at 10:07 AM
Hello, maybe you should check in the google how to change direction of gravity of rigidbody, i never try this but i am already read some too, and it say it can not do that. https://answers.unity.com/questions/705876/how-do-you-change-the-direction-of-gravity.html#:~:text=You%20can%20change%20the%20Vector3,but%20going%20the%20other%20way.
You should do your own with gravity system (do not use rigidbody gravity).
I will drop clues that maybe to be keywords to do this, use translation for movement. interpolation for acceleration, and gravity must multiple by direction toward position of tube core.
Hope it help.