Slope issues

hankster112

  • Posts: 27
Continuing from https://community.stencyl.com/index.php/topic,61751.msg317666.html since it got buried.
I've figured out movement a bit better, but I still have two major issues. When traveling down a slope, the player will constantly go on/off the slope, which I assume is due to the X movement carrying the player into the air by made 1-2 pixels only to have gravity bring them back down onto the slope, repeated ad infinitum.
The other issue is that when the player reaches the top of the slope, they do a small hop before returning to normal movement. What are some ways I could go about fixing this?

Luyren

  • *
  • Posts: 2816
The hop happens because of the physics engine.

The same link for my Utility Pack that I posted in the other thread. Using that, you can make your slopes as semi-solid actors, and the player or any other actor can smoothly move along the semi-solid, as you might be able to see in the sample game.

The 1-2 pixels is most likely because your animations are not all the same size for your actor, and the base of their collision boxes don't match, specially of their on ground and falling animations.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

hankster112

  • Posts: 27
Figured out this issue, I was completely overthinking it. There's a block that lets you set the actor's velocity to a specific degree and speed. Put that in and set the degrees to the same angle as the slope, set the speed, and it glides along angles now without issue.