#getting stuck

3 messages · Page 1 of 1 (latest)

rose thicket
#

(I'm using old code so I don't know if this is what's giving the error)
For some reason every time I'm walking for an hour I get stuck on the ground and can't move, and gravity gets heavier and heavier

obj wall solid

This code is on the player

My code create:
gravity = .08

My code step
var movespeed = 5;
var jumpspeed = 10

If keyboard_check (vk_space) {
y -= jumpspeed
}
If keyboard_check (ord("S") {
y += movespeed;
}
If keyboard_check (ord("D") {
x += movespeed;
}
If keyboard_check (ord("A") {
x -= movespeed;
}

If gravity < .08 {
gravity = .10
}

End

If anyone knows how to fix it and stop me from sticking to the floor I would be very grateful

rocky whale
#

nothing wrong with this. it sounds as if you might be using the inbuilt gravity system. check to see if that's enabled.

gray lintel
#

This is an issue with the solid checkbox. The way solid works is that if you're overlapping at the end of the frame, it moves you back to where you were previously. That means that when gravity moves you into the floor, you will always get moved back to where you were last frame, overwriting any horizontal movement. This is why the solid checkbox is a bit of a trap and not recommended