SOLVED Simple platformer movement issue

K

kneb

Guest
Hello,

I'm trying to do an extremely simple movement with a block over the floor.

The light-grey object has Set Gravity and when collides with the floor (solid) it stops moving horizontally.
The horizontal movements (applying Set Speed) work fine while in the air, but why does it get stuck when touching the floor?

Same result with the character as non-solid.

Thanks in advance for any help this noob can get đź‘Ť


1613689839767.png
1613689715014.png
1613689916300.png
1613690587314.png
1613690443125.png
 

Nidoking

Member
Looks like you're using the solid property and leaving gravity set to .3 even when you're on the ground. That means that when you're on the ground, you're colliding with the platform (due to getting positive vspeed from gravity) and snapping back to where you started the step (due to the solid property). You'll have to change one or the other of those properties, or both, to get the results you want.
 
My first advice would be to avoid the drag and drop and just start learning GML out of the gate because it's not a difficult programming language and that's a better use of your time.

The drag and drop is really just a leftover from when Game Maker was designed as a learning tool and mostly good for introducing kids to game development in a simple way.
 

Slyddar

Member
My first advice would be to avoid the drag and drop and just start learning GML out of the gate because it's not a difficult programming language and that's a better use of your time.
To the OP, people will tell you this all the time. In the end use what you are comfortable with.

In saying that I'm going to recommend avoiding the in-built speed, gravity and solid options as they are a little cumbersome to use. I have a series on making a DnD platformer using a different method, and although it's a little complex for a beginner beginner, maybe give try a that.
 
To the OP, people will tell you this all the time. In the end use what you are comfortable with.

In saying that I'm going to recommend avoiding the in-built speed, gravity and solid options as they are a little cumbersome to use. I have a series on making a DnD platformer using a different method, and although it's a little complex for a beginner beginner, maybe give try a that.
People say that because if falls under harsh but true.

It's a waste of time to spend months teaching yourself how to do complex things in DnD when you could've just gotten a headstart on GML because even a very basic understanding of the language allows you do things is a far less frustrating way than trying to build anything substantial in drag and drop.

I speak from experience because I've 100% built games in DnD in the past and in hindsight it was a far greater pain than doing the same functions in code, as backwards as that sounds.
 
K

kneb

Guest
Thank you for all the tips guys! Got the problem. Weird that in this tutorial the way tried worked with no problems. I guess the engine changed but nvm.
I've done some GML, is indeed easy to learn, still I need to improve with logic.

Thanks for the support!
 
K

kneb

Guest
In saying that I'm going to recommend avoiding the in-built speed, gravity and solid options as they are a little cumbersome to use. I have a series on making a DnD platformer using a different method, and although it's a little complex for a beginner beginner, maybe give try a that.
I've done your tutorials before, they got me started well, truly appreciate them!
Was just looking if it was possible a simpler implementation the way I used to do 10 yrs ago in GM, but apparently doesn't work/worth anymore.
Thank you!
 
K

kneb

Guest
Looks like you're using the solid property and leaving gravity set to .3 even when you're on the ground. That means that when you're on the ground, you're colliding with the platform (due to getting positive vspeed from gravity) and snapping back to where you started the step (due to the solid property). You'll have to change one or the other of those properties, or both, to get the results you want.
That was the problem indeed, thank you! :D
 
Top