# Someone help me with this [SOLVED]

I want to make a 2D Third Person Platformer like this.

But im struggling on how to jump from one place to that place

1 Like

@Johan_Sipili Making a platformer can be hard, but I have an example that you can use. Feel free to use any of the code. platformer example6-28-2024_10-40-39.wick (7.4 KB)

1 Like

Thanks! but please look at the picture, the views are different
The photo is a Birds eye view but I think Im able to work with your code

Off topic but I just realized from your code its from I no longer believe in gravity post and I have been putting the update part of your frame into my characters Update script

I lied to myself

I have also found a glitch with ONLY my character I made for my game
platformer example2 I have no idea whats wrong with it but this glitch only happened with that character i made. Nothing else.

See for yourself and youll know what i mean

Oh. Sorry

I hope someone comes and helps me fix this, this is a major problem for my game

I dont think its your problem, I know where the gravity comes from
I think its the code? or the stickman drawing i made?

I see the error.

Itâ€™s because this gravity system works based on the y value and height of the playerâ€” which are constantly changing in your player since itâ€™s changing frames.

Allow me to demonstrateâ€” assume this gray box is the player.
The code will use the height and the y-value of the middle point

And the code will set the y-value of the player to be above the ground by half of the playerâ€™s height. That way, itâ€™ll look like the player is on the floor.

Nowâ€”

To understand why this glitch happened, weâ€™ll take a look at your character.
Below, I marked the y-value and the height of your player.

Now, notice when I take half of the height, it goes a bit over the y-value?

In other words, if I tried adding half of the height to lift the player off of the floor, itâ€™ll end up actually floating, like this:

And when itâ€™s floating, itâ€™s not touching the floor, so it will fall again. Then itâ€™ll touch the ground, and end up floating again. Then fall again. Then float. Then fall. Then float. Thenâ€¦ you get the idea.
This is because everything inside of the clipâ€™s timeline is not centeredâ€¦

Not to mention that every one of your animation frames will give the character a different size.

So, it may seem a bit complicated nowâ€¦ you might be wondering how to solve this?
Well, you have two solutions.

# Solution 1

Go inside of your clipâ€™s timeline, and just add a huge box. This will count as a hitbox for the collision.
You can make the opacity of the box zero to hide it. You also want to make sure that the y value of this box is zero. You can move your player up and down, make the box smaller or bigger, but keep the y value of the box zero and and keep the player inside of it.

# Solution 2

You can take the animation, the player, and make them two separate clips!
This would probably be the better solution.

What youâ€™re doing here is putting all the gravity code inside of a simple box, and putting all of the animation code inside of another clip, then youâ€™ll just need to tell the code to set the x and y values of the animation to the x and y values of the player clip.
Hereâ€™s an example click me for wick file (85.3 KB)

Whatâ€™s nice about this method is you can resize the player as you wish and do whatever you want with the animation, and since theyâ€™re separate clips, what you do in one wonâ€™t affect the other. This also makes it way easier to replace the animation with another animation if you wanted to pick a different character.

## One more thing!

I remember writing the I no Longer Believe in Gravity code around 3 years ago, that was around the time I started learning to code so the whole gravity code stuff is not perfect â€¦ but itâ€™s a very easy and simple gravity system to understand! So you can keep using it, though if youâ€™d like a more perfect collision system, Iâ€™d recommend trying out Baronâ€™s Platformer engine

1 Like

Thanks! (ten letters)

1 Like