D
DDanny
Guest
Hi,
I'm currently using a rope joints (physics_joint_rope_create) to connect multiple "rope segments" and create a rope. This method is very popular for making a rope and so far it's been working fine for me - 2 objects connected with a rope will move together in a believable fashion.
However, there's this weird behavior of the joints when 2 of them get slightly separated through a wall (which they were supposed to collide with), one of them would fall down, as if it was connected to nothing. Illustrated below:
Normal rope:
Collide with ground:
Weird stuffs (pt. 1)
Note the the black lines are simply drawn between 2 segments, they have no physical properties.
Weird stuffs (pt. 2)
The box has the same density as any rope segment.
Just for reference, here's my code that connects the segment:
Really hope someone can put out some thoughts and opinions on this so I can have a direction to fix this problem. Thinking about actually restricting the movement of the segments from eachother by code but that could potentially ruin the integrity of the physics system.
I'm currently using a rope joints (physics_joint_rope_create) to connect multiple "rope segments" and create a rope. This method is very popular for making a rope and so far it's been working fine for me - 2 objects connected with a rope will move together in a believable fashion.
However, there's this weird behavior of the joints when 2 of them get slightly separated through a wall (which they were supposed to collide with), one of them would fall down, as if it was connected to nothing. Illustrated below:
Normal rope:
Collide with ground:
Weird stuffs (pt. 1)
Note the the black lines are simply drawn between 2 segments, they have no physical properties.
Weird stuffs (pt. 2)
The box has the same density as any rope segment.
Just for reference, here's my code that connects the segment:
Code:
var offset = 0;
var maxLength = 0.1;
var nextRope = instance_create_layer(x, y, "instances", obj_rope);
var heli = instance_nearest(x, y, obj_heli);
var attach = physics_joint_rope_create(heli, nextRope, heli.x, heli.y, nextRope.x, nextRope.y, maxLength, false);
physics_joint_set_value(attach, phy_joint_max_length, maxLength);
with (nextRope) {
lastRope = heli.id;
}
repeat(100) {
offset+=0.1;
var currentRope = nextRope;
nextRope = instance_create_layer(x, y + offset, "instances", obj_rope);
var link = physics_joint_rope_create(currentRope, nextRope, currentRope.x, currentRope.y, nextRope.x, nextRope.y, maxLength, false);
physics_joint_set_value(link, phy_joint_max_length, maxLength);
with (nextRope) {
lastRope = currentRope;
}
}
var box = instance_nearest(x, y, obj_box);
attach = physics_joint_rope_create(nextRope, box, nextRope.x, nextRope.y, box.x, box.y, maxLength, false);