K
Karam Al-Kofahi
Guest
At certain points in my game, the collision mask can move a pixel or two in either left or right when the sprite is not moving. This doesn't make any sense to me and I don't know why this is happening.
I am using GM1.4, and the player can move the character left and right with "A" and "D", and it adjusts their hspeed to be either -2, 2, or 0 if neither are pressed. I have a boat object which moves the character to align with it's speed, and the player can freely move around while on the boat. For example, if the boat has an hspeed of 20, pressing "A" will make the player's hspeed 18, and if "D" is pressed, then the player's hspeed would be 22. I did this by using a collision event in the boat's code to write the following:
obj_player.x += hspeed
this works perfectly, and the player can freely move around at ease, but after making the player's collision mask visible, I noticed that it bounced left and right whenever the player was touching the moving boat. This makes collision's with walls and other sorts of objects not work properly, and I haven't been able to find a solution. here is a video depicting the issue
https://imgur.com/4jbKPxG
the black box is the collision mask for the player, and the black box attached to the left end of the boat is the boat's wall essentially. I didn't show it in the video but the player gets stuck in the wall whenever he gets too close while the boat is moving. I am certain this is because of the glitching collision mask. If anyone knows a solution, I would love to hear it. Thanks guys
I am using GM1.4, and the player can move the character left and right with "A" and "D", and it adjusts their hspeed to be either -2, 2, or 0 if neither are pressed. I have a boat object which moves the character to align with it's speed, and the player can freely move around while on the boat. For example, if the boat has an hspeed of 20, pressing "A" will make the player's hspeed 18, and if "D" is pressed, then the player's hspeed would be 22. I did this by using a collision event in the boat's code to write the following:
obj_player.x += hspeed
this works perfectly, and the player can freely move around at ease, but after making the player's collision mask visible, I noticed that it bounced left and right whenever the player was touching the moving boat. This makes collision's with walls and other sorts of objects not work properly, and I haven't been able to find a solution. here is a video depicting the issue
https://imgur.com/4jbKPxG
the black box is the collision mask for the player, and the black box attached to the left end of the boat is the boat's wall essentially. I didn't show it in the video but the player gets stuck in the wall whenever he gets too close while the boat is moving. I am certain this is because of the glitching collision mask. If anyone knows a solution, I would love to hear it. Thanks guys