• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Car turn angle link to tyre angle

Greetings all,

I have a vehicle which turns according to the code below. It works correctly.
However, I am also animating/adjusting the tyre angles and I need a way to "link" the tyre angle to the vehicle turn code. How might this be done?

Code:
image_angle += max(0.5, turn_speed * (1 - (current_speed / max_speed) * turn_speed_factor))
// where turn_speed_factor further affects the amount of turn at slower or higher speeds
 
So with some more work, I've solved this. The approach was thus;
Put an x, y coordinate out in front of the car in the direction the wheels are facing (lengthdir_x, lengthdir_y), and then have the car turn in the direction of that point. Using a Gamemaker script scr_angle_approach in coordination with the code snippet I posted above.
 
Top