
obj_player.other_obj_applied_speed = speed_to_apply if condition to apply the extra speed is met:Ģ. The solution was to instead of the other object directly manipulating the player's speed, it set a variable that would be applied to the actual speed in the player's step event, before the collision part of the code. This made so that, as the other objects events were read later in the frame, the speed was applied after the collision code. What happened to me was that there was another object that could manipulate the player's speed other than the player itself. I know this is not a problem anymore, but I maybe can help you understand the problem. While (!place_meeting(x+sign(ayerspeed),y,obj_player_parent)) If (place_meeting(x + ayerspeed, y, obj_player_parent)) Horizontal collision to avoid getting stuck in wall

I also changed his sprites to my new ones. He also had a couple of problems with getting stuck in the walls, but only the opponent used to get stuck when he moved back into the wall after getting hit.

I'm wondering if it's because Game Maker isn't recognising a variable I made global, called "ayerspeed" instead of hsp.īy the way, I'm making my game with someone else's code. I even used another solid object (placed over the wall object) and used a normal collision event between that and the player object. Plus, I also used Shaun Spalding's video tutorial about platformer basics, and set a collision checker preventative measure against getting stuck in the walls. I set my player object mask as a sprite, so that the sprites wouldn't change and stick me into the wall.Īlso, I made sure that sprite had an odd number of pixels and set the origin to the exact pixel horizontally in the middle of the sprite. So I'm making a fighting game and my character is getting stuck in the walls.
