SOLVED Character Can't Move Horizontally

C

CarolineGStrong

Guest
Heya,

I'm incredibly new to GameMaker and I'm working on a project for my university course. It's a very basic plat- former. I added double jumps and varied jumps but suddenly but character won't move horizontally. I've checked to see if it's the new features but it doesn't seem to be the case.

Any advice would be very much appreciated x
 

Attachments

Roderick

Member
Code looks ok.

Are you starting your character on the ground in the room? It's possible that you've placed it so that it clips into the ground. Try raising it up so that it falls as soon as the game starts.

Also, if you're using precise collision checking, you might want to consider not. It can cause all sorts of issues with platformers. It's usually best to just use a rectangular bounding box, in my opinion.
 
C

CarolineGStrong

Guest
I was but with your suggestion I turned it off, I found that it was the positioning of the code which has causing it to collide with the floor. My character starts in the air so it falls because I was worried about the clipping.

I moved the 'x += hsp;' piece of the code upwards but now my character impales itself into the platforms instead of bouncing off/ stopping.

Attached is the new set up of the code and an example of the character impaling itself.

(I know it looks awful, it's still using placeholders)
 

Attachments

C

CarolineGStrong

Guest
Hiya!
Thank you for the help - I decided to completely re-write the code and now it's fixed. No idea what was causing the issue however x
 
Top