• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

[Solved] Player can't walk past a certain Y co-ordinate for no apparent reason.

RADRI

Member
Exactly what it says on the tin, when trying to walk down inside of a room, the player is blocked at around the Y co-ordinate of 760 even though there are no solid objects or things to collide with at that point.
The only thing I can think of is that all my previous rooms had the dimensions of a width of 1024 and a height of 768 while this room has the two switched and the player seems to stop moving around y-768 but I have no idea why that would cause a problem.
Any help is appreciated I'm just very confused.
 

RADRI

Member
I've run a few tests and if I place the player object below y-coord of 768 it moves around fine but again cant go up past 768 y, if I place it above it moves fine but can't go below 768-y and if I place it directly at 768-y it still turns in the right directions but it can't move at all.
There is nothing there at that Y, I don't know whats' causing this.
 

samspade

Member
I've run a few tests and if I place the player object below y-coord of 768 it moves around fine but again cant go up past 768 y, if I place it above it moves fine but can't go below 768-y and if I place it directly at 768-y it still turns in the right directions but it can't move at all.
There is nothing there at that Y, I don't know whats' causing this.
There's nothing in GM that would cause that. You'll need to post your code. Your move code can't (or at least shouldn't) be that long. Start with that.
 

RADRI

Member
I used dnd to code the players movement, so those two captures show what happens when the left key is pressed down and released, it's the same for the rest of the movement keys but just with switched directions and sprites. Everything works with movement in all other rooms so far.
 

Attachments

samspade

Member
What do the rest of the events look like? Given that it is drag and drop, I would definitely start removing events and seeing when the problem stops. You can copy the object first if you're worried about losing it.

I think, but am not sure, that there's a button on object window that gives you all of the code for that object in all events as something that you can just copy and paste. That would be the most helpful.
 

Timothy

Member
Are you sure you don't have solid objects that are either not visible or the same color as the background? I see in that image that you have a collision event with "border".
 

RADRI

Member
Are you sure you don't have solid objects that are either not visible or the same color as the background? I see in that image that you have a collision event with "border".
That's what the border looks like currently in the room, I already deleted all the border on the bottom side.
 

Attachments

RADRI

Member
What do the rest of the events look like? Given that it is drag and drop, I would definitely start removing events and seeing when the problem stops. You can copy the object first if you're worried about losing it.

I think, but am not sure, that there's a button on object window that gives you all of the code for that object in all events as something that you can just copy and paste. That would be the most helpful.
The rest of the events are all collision events that are all exactly the same exactly like in the image so I don't think it's there but I will try to delete them and see if it works!
 

Attachments

pipebkOT

Member
@RADRI

make sure the rooms are not persistent, otherwise your colission objects would be carried over in this room, also make sure your objects are not persistent



don't use persistent objects and rooms if you don't know how to use this characteristic!!

only the player object should be persistent because it need to be carried over when you go between rooms
 
Last edited:

TsukaYuriko

Q&A Spawn Camper
Forum Staff
Moderator
Did you perform any tests to see whether there actually are no invisible walls? This could be done by temporarily making them visible, or notifying yourself somehow if they are blocking the player. Just checking the room in the room editor is not guaranteed to catch this sort of stuff, as the room editor is not the only method through which instances can be created (or carry over into other rooms through persistence, as has been mentioned by others).
 

RADRI

Member
Oh my god do I feel dumb now, yeah the borders were persistent which was the issue.
Thankyou everyone!
 
Top