Thank you for your reply!
So let's say that I have two models: a rope model and a bucket model. I also have an invisible third model to use as the joint. I have this third model at the ceiling in the correct position. The rope and bucket models are also in position.
I should use a hinge joint to connect the rope to the invisible ceiling model, and then a ball joint to connect the rope to the bucket? Every time I create a ball joint, the bucket model just falls to the ground. Can one model have multiple joints?
Here's the code I'm using so far, which doesn't work:
Code:
entity* joint;
entity* joint2;
entity* rope;
entity* bucket;
action joint_high
{
joint2 = me;
}
action bucketrope
{
var ball_id;
rope = me;
wait (3);
phent_settype (my, ph_rigid, ph_box);
phent_setgroup (my, 2);
phent_setmass (my, 5, ph_box);
ball_id = phcon_add (ph_hinge, my, joint2);
phcon_setparams1 (ball_id, joint2.x, nullvector, nullvector);
phcon_setparams2 (ball_id, nullvector, nullvector, nullvector);
}
action joint_low
{
var ball_id;
joint = me;
wait (3);
phent_settype (my, ph_rigid, ph_box);
phent_setgroup (my, 2);
phent_setmass (my, 0, ph_box);
ball_id = phcon_add (ph_hinge, my, rope);
phcon_setparams1 (ball_id, rope.x, nullvector, nullvector);
phcon_setparams2 (ball_id, nullvector, nullvector, nullvector);
}
action act_bucket
{
bucket=me;
var ball_id;
wait (3);
phent_settype (my, ph_rigid, ph_box);
phent_setgroup (my, 2);
phent_setmass (my, 20, ph_box);
ball_id = phcon_add (ph_ball, my, joint);
phcon_setparams1 (joint, nullvector, nullvector, nullvector);
}