Advertisement

gravity problem

Started by February 15, 2013 08:44 AM
0 comments, last by tomdb 12 years ago

here my problem.

With "medium" downForce my collisionresponse/sliding is very nice.

with "high" forceDown (good when falling outside the level) the sliding is jerky.

medium force = problem when falling outside, the player falls to slow.

high force = problem for player to go uphills. if i set the gravity that is good for falling the player have not enough power to go uphills wihout gravity pushing player down.

I would like a gravity that is good enought from basic with freefall and also so the player can climb hills?

Do i have to calculate two different gravity, one for on plane and one outside plane?

Also, i rotate my whole gamelevel so when rotation begins i need the player to slide down the floor at a good speed.

A good speed now on ground is to slow. that makes two gravities now work.

I hope you understand my problem.

When using strong downForce, my collision sliding becomes jerky and player can´t walk uphills (even moderate hills).

I use v- = n * dot(n,v) but i don´t feel it makes any change to my gravity / shouldent this formula reduce gravity once on contact with a plane?

Ok, I don't know if I understand your problem exactly but this is how I am trying to handle this. I don't know either how you handle your movement.

But to the point. Whenever an object is moving, I generate an 'action'. I put this action in a ActionQueue, and every frame I execute all the actions in the queue. The key to my system is that there can't be a 'up-movement'-action and a 'down-movement'-action(like gravity) at the same time in the queue. So when I generate a gravity-action, I first check if there's already a jump-action, if yes: I don't do gravity, if no, gravity is fine. So instead of having two separate gravity-speeds, I have to gravity-states: 1) Full gravity, because an object is in the air and is not jumping and 2) no gravity, because either the object is jumping or it isn't on the ground.

I hope this makes sense ;).

Tom

This topic is closed to new replies.

Advertisement