N
Neo
Guest
I am trying to snap an object to my previous snapped position to create following object. Something like the old pokemon follows you around. I think it is easy enough but cant seem to make it work any ideas? In my code now it snaps right on top of me. I need to figure out a way to make the cage object always snap to me but be one snapped position from me for example if I am at x=16 y=16 then i move to x=32 y =16 the cage should be at my previous snapped position 16,16, but with my code it snaps to my current position 32,16. I know it is simple just can't figure it out.
if place_snapped(16,16)
{
if x!=cageSnapx
cageSnapx=x
if y!=cageSnapy
cageSnapy=y
}
I then have a following object called cage that has this in the step event
x=obj_man.cageSnapx
y=obj_man.cageSnapy
if place_snapped(16,16)
{
if x!=cageSnapx
cageSnapx=x
if y!=cageSnapy
cageSnapy=y
}
I then have a following object called cage that has this in the step event
x=obj_man.cageSnapx
y=obj_man.cageSnapy
Last edited by a moderator: