Game maker sticking to walls
Last edited by Allie HM ; 15 Apr, pm. Showing 1 - 7 of 7 comments. Blind View Profile View Posts. Collision code is probably stopping your object without actually removing the object from the collision, resulting in a permanent state of collision. Zappy View Profile View Posts. You might want to make the sprite angle completely separate from the collision angle. If you take a square and rotate it 45 degrees, it will now have points farther up, down, left, and right than before, and if those points then clip into a wall as a result of an object rotating around, the object will be stuck.
This gets even "worse" if the origin of the sprite used for collision is not at the center of the collision mask. Originally posted by agfarina :. Anytime you have a moving object with a collision mask that changes you can run into a lot of issues.
Originally posted by Negative Headed :. Originally posted by Stambimmy :. The sprite mask will be invisible. Just make it a circle. You don't need to use the draw event though. You can set the sprite to the sprite you have and in the box below where you set the sprite you can choos the circle as the mask. Takio View Profile View Posts. A circle as collisionmask for the walls is the best option, since shapes with corners can always have one of them that can get stuck. But I think you can set another seperate collisionshape for different purposes.
Last edited by Takio ; 13 Aug, pm. Whoops, I accidentally replied to my own post and don't know how to delete it. FrostyCat Member. The most common cause of characters getting stuck in platformer walls is using animated sprites without a static collision mask. Make a solid-fill, one-frame rectangular sprite with the same size and origin as your character, then go into Object Properties and set Mask to it.
FrostyCat said:. Last edited by a moderator: Sep 1, Either that or take out the global. Except, I don't think there is an "origin for my character", because my character object is a parent with no sprite attached to it. Yal said:.
Do all the children use the mask as well, or just the parent? What's the error message? Copy the text and paste it here. Okay, so I kind of solved this, but not really, but kinda did. I simply remade the game again, and the problem didn't happen anymore. I didn't really figure out how to fix the problem, but rather just found a way around it.
Should I mark this thread as solved? I was referring to what you called a "red error" Nah place it in the Step Event.
The Create Event only runs things once aka - when the object is created.
0コメント