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

Joint Index

M

MUZZY

Guest
How exactly do you get the index of a joint in game maker? I want to create a joint and delete it afterwards.
 
A

Aura

Guest
All the physics_joint_*_create() functions return the index of the created joint. You can store it in a variable:

Code:
joint_id = physics_joint_wheel_create(id, o_id, o_id.x, o_id.y, 0, 1, true, 10, 1, 15, 6, false);
...and then delete it afterwards:

Code:
physics_joint_delete(joint_id);
 

Yal

šŸ§ *penguin noises*
GMC Elder
All the joint creation functions seem to return that index according to the manual.
upload_2016-7-9_15-12-43.png

So you'd do something like this:
Code:
myJoint = physics_joint_gear_create(inst1, inst2, joint_1, joint_2, ratio)
 
M

MUZZY

Guest
All the physics_joint_*_create() functions return the index of the created joint. You can store it in a variable:

Code:
joint_id = physics_joint_wheel_create(id, o_id, o_id.x, o_id.y, 0, 1, true, 10, 1, 15, 6, false);
...and then delete it afterwards:

Code:
physics_joint_delete(joint_id);
All the joint creation functions seem to return that index according to the manual.
View attachment 1002

So you'd do something like this:
Code:
myJoint = physics_joint_gear_create(inst1, inst2, joint_1, joint_2, ratio)

Thank you both for the quick replies!
 
Top