• 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!

Updating motor_speed

J

jason

Guest
I have created a car object that has wheels connected with a wheel joint.

Is there a way to change the motor_speed of the joint with a button press after it is created?
 
R

Rusty

Guest
keyboard_check_pressed command will check if the keyboard has been pressed.

if keyboard_check_pressed(vk_up)
{ motor_speed+=1;}

It's really basic GML.

Edit:
Haha, no I need to go to sleep. For some reason my brain just didn't register that this was a physics related question. Yeah, sorry about that.

I believe you can update the motor speed using "phy_joint_motor_speed" but I'm not entirely sure how that works as I've never really indulged myself into Game Maker's physics engine.
 
Last edited:
J

jason

Guest
Well, I ended up using physics_apply_torque to the wheel object. So the wheel spins, but the wheel joint falls apart. So I'm not sure what I'm doing wrong there.
 
Top