Hi people
I am new to Unity and trying to make a real simple game that relies almost exclusively on the physics engine and have found that the physics engine is without my understanding.
Please allow me to post my problems and please see if you can help me out.
The game I want to make is almost like the rolling levels on i-Ninja on Xbox (or Sonic 2 on the Genesis) where you are a ball rolling through a track, sometimes at breakneck speeds. Your controll over the PC (player character) is simply left and right force additions for direction changing and forward and backward for speed adjustments. The levels would be something like i-Ninja with various obstacles to overcome except the PC should never be able to actually roll backwards except on a flat surface and the PC should never be able to move up a slope.
The PC is a simple sphere created using Unity. When I place it in the game and place it above the track, it falls down VERY slowly indeed, no matter how much mass it has. To solve this I changed the gravity field to 30. So that is the first problem solved.
:?: The second one is the relationship between force and mass. If I make the force strong enough to actually move the ball at a reasonably fast speed, then the force is so strong that when I hold down the backwards movement key, it goes up the slope for the level. It should not be able to move up the slope at all. The method I use to stop this from happening is to increase the mass, but then the force is not strong enough to move the marble except at crawling speed… What’s up? How do I solve this?
Lastly, and more importantly, my ball doesn’t behave like I would have expected it to. I simply decided to build this game to test the physics engine and so far it doesn’t seem to do what I expect. When I set the ball in motion, I want it to move forward at the speed at which it is being pushed, then when it reaches the slope, it should start rolling down and gain speed/velocity/momentum/whatever. At the moment, when it reaches the slope, it goes down the slope without the need for me to press any buttons, but the speed of the marble stays constant throughout. How do i create more lifelike physics here?
:?: And lastly, for movement I use the script from the tutorial. The one where the guy builds the level with his son and then scripts the movement for the marble. Forward speed is calculated by using the “vertical” keys, yet when the ball gets to the end of the slope, I press the backwards movement key and the ball just keeps going. Slowly like ever, but forward non the less, for about 10 to 20 seconds, then it changes direction and comes back, ever so slowly still, before moving up the slope still ever so slowly… Because it moves up the slope I assume my force is immence. So why does the slow moving ball not stop for 10 to 20 seconds?
Also, the camera is all wierd using this script. It uses the marble’s forward vector, without the y and then places itself behind the marble. Problem is, the marble is constantly rolling so it’s forward vector changes with every frame. As a result, the camera is forever rotating around the ball, rotating on it’s own y axis. This makes me dizzy.
:?: How do I place a camera behind and above a marble that is always rolling on a track that is winding and curving? For the y aspect, I assume I get the ball’s y transform and then simply add my height to it, fine. But how do I tell the camera which way is forward if the marble’s forward vector changes every frame and the level itself takes a few turns as well?
I never thought a simple game like this could have so many problems… Sheesh!
:!: What i would like from you fine people, is if you could tell me what settings I need to set to what to create physics that can emulate the effect of throwing a marble into a round glass bowl with enough force to send it rolling up the side, but not enough to send it flying out the other end. It should be rather fast as you would expect in real life and make zig-zag motions while gradually decreasing the radius of movement before finally coming to a stand still in the centre. The physics should be set up to do this all automatically and the actual movement should be dictated by the confining shape.
:?: Is the included physics engine capable of doing this or is it just a rudamentary physics engine that requires me to build this functionality via complex scripting?
If it can be done and if you could tell me what setting needs to be what, would you please explain to me why one settings has to be something rather than another setting sommething else, please?
Your assistance in this regard would be most appreciated indeed!
Sincerely
Jacco