- Home /
It doesn't seem like anyone has an idea.
Ball rolling on platform
I am working on a 2.5D project where I need to move a ball upwards on a platform by rotating the platform on the Z-axis and moving the platform on the Y-axis. So basically, the platform rotates left and right and moves up and down. The ball should roll nicely along the platform.
The ball is just a sphere with a rigidbody attached. When I move the platform, I want the ball to roll on it rapidly, pretty much like a ball bearing on a wooden platform.
I've gotten a pretty good effect by increasing the mass of the ball greatly (1000 right now) and adding a large amount of constant downforce (-250000 when the platform is moving up, and -30000 when it's moving down). The problem I have right now is that when I move the platform downwards, the ball bounces very sporadically. As I increase the downforce, the bouncing interval decreases, but the amount seems about the same; as I decrease the downforce, the interval increases, and makes the ball bounce lightly across the platform.
What I'm after is a way to have the ball hug the platform and respond rapidly to changes in the angle of the platform. I've tried wheel colliders with pretty much the same effect, but I'm open to anything at this point.
I don't know that increasing the mass of the object like that and applying that force is the solution you want.
How large is the ball and the platform it rolls on, in Unity units?
The ball is (1, 1, 1). The platform mesh is (21, 0.5, 1). The box collider on the platform is (1, 4, 5.48). I'm open to any suggestions at this point; a completely different approach is fine if it works. Thanks!
I've also tried adding torque to the rigidbody in the opposite direction that the platform moves. This works fairly well, but I'm still fudging the physics rather than working with them to create a more realistic model, which is what I'm really after.