P
Pikpik
Guest
I have an object that when the player collides with it, their x position should be set to the center of that specific instance. How would I accomplish this?
x = inst.x + inst.sprite_width/2;
y = inst.y + inst.sprite_height/2;
// inst = the instance that you are colliding
// you can use "other", depends on how you are performing the collision. It also depends on other factors such as sprite alignment.