#(resolved) Help needed for placing multiple layered objects on X axis
1 messages · Page 1 of 1 (latest)
Step event:
Create event:
Left pressed event:
(Not resolved yet) Help needed for placing multiple layered objects on X axis
what I'd suggest is instead of having that 606 hard coded, give each bar a set of variables with each "slot"
slot1X = 606;
slot1Inst = noone;
slot2X = 550;
slot2Inst = noone;
//when placing the weight on the bar
var bar = instance_place(x, y, obj_legpressbars);
if bar.slot1Inst == noone {
slot1Inst = id;
x = bar.slot1X;
}
else if bar.slot2Inst == noone {
//repeat
}``` something like this
there's more efficient ways to do it with stuff like arrays and structs, but this lets you do it with simple code
You could also consider something like slot1X = x + something, so you don’t have to figure out the exact coordinates for every bar