Problem with move/tilt/roll

Posted By: GameScore

Problem with move/tilt/roll - 12/08/13 11:02

Hey Hey laugh

i got a bit a problem to calculate how to crazy

i got a car entity and when the car accelerate/brake
it should tilt a bit,but when i change the tilt value
the car would change his direction a bit downward

how can i sub this downward direction?
Posted By: DLively

Re: Problem with move/tilt/roll - 12/08/13 15:15

c_move(ENTITY* entity,VECTOR* reldist,VECTOR* absdist,var mode)

Use the absdist instead of reldist. This will move the entity along the word co-ordinates rather than its own. When you tilt the car it wont move in its tilt direction.

Hope this helps
Posted By: GameScore

Re: Problem with move/tilt/roll - 12/08/13 20:28

lol, how easy
i forgot^^
thougt i must calcualte some strange mathematics grin


but now i have a another problem
when i turn the car left or rigt 180°
the buttons will be mirrored

i mean foward will be backward now^^
Posted By: EpsiloN

Re: Problem with move/tilt/roll - 12/11/13 07:13

In this case you have many options, but what I'd do is this:
Store the tilt of the car in a temporary local variable.
Set the tilt of the car to 0.
Move the car on relative movement.
Reset the tilt of the car to the local temporary variable that you stored.

This way the car will move forward and still be tilted in a direction, and you avoid the headache of using absolute movements laugh
© 2023 lite-C Forums