0TastyPie0
Member
I'm working on a marble run type game, were the player can draw lines for the marble to run down. I use fixtures to setup and draw the line, however other physics objects (such as the marble) seem unaffected by the line. They simply pass through it, when the line is suppose to act as a wall.
This is the code I used to bind the fixture to an instance, once the last point has been recorded:
"fixture" variable is were the fixture is located. "lastX" and "lastY" are the last coordinates recorded. I set density to 0 since I want the line to be static.
From what I've read in the manual, this is all i'm supposed to have to do for it to work.
I used this other forum post as reference to figure out fixtures (but the original poster didn't seem to have this issue):
https://forum.yoyogames.com/index.p...-line-on-mouse-move-that-have-a-physics.5776/
This is the code I used to bind the fixture to an instance, once the last point has been recorded:
Code:
// Create the Custom Wall
physics_fixture_set_density(fixture, 0);
var inst = instance_create_layer(lastX, lastY, "Instance_Walls", oWall);
with (inst) {
// Copy Over Points for Drawing the Line
var len = array_length_1d(other.pointsListX);
array_copy(pointsListX, 0, other.pointsListX, 0, len);
array_copy(pointsListY, 0, other.pointsListY, 0, len);
points = other.points;
}
physics_fixture_bind(fixture, inst);
physics_fixture_delete(fixture);
From what I've read in the manual, this is all i'm supposed to have to do for it to work.
I used this other forum post as reference to figure out fixtures (but the original poster didn't seem to have this issue):
https://forum.yoyogames.com/index.p...-line-on-mouse-move-that-have-a-physics.5776/