Standalone Slope Management

Galdon2004

  • *
  • Posts: 313
So a while back I had asked about slope management and was recommended using a behavior that was part of a bundle.

It worked at the time, but as I have built more to the game, I have found that it no longer works; the issue appears to be that one of the protagonist's forms has an animation that goes below the feet so the bottom of the collision box is no longer the bottom of the actor and that messes it all up.

So, I am now looking to figure out a solution to have sloped tiles work using a standalone behavior coded from blocks rather than being a part of a bundled system that I cannot tweak easily. There are three challenges it seems like I need to overcome; stopping the player from being slowed upon touching a slope, ensuring the player does not "hop off" the top of the slope, and ensuring the player stays *on* the slope when running down the slope.

I am thinking that I can do the slope detection for running up the slope with tile data and tweak the physics for it until it seems right, but while that may work for going up the slope, I'm not sure what I might try to do for going down, as the actor flies straight off the slope and does not stay in contact with it to detect it's presence.  Any advice, tips, or guidance would be greatly appreciated.

Luyren

  • *
  • Posts: 2747
My utility pack can handle slopes with semi-solids. That bypasses the physics quirks and completly avoids the hop going above ledges. You can use it or try to learn how to do it from them.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Galdon2004

  • *
  • Posts: 313
Yeah, that is what I used before, but the actor for one of my character's forms breaks it. They have a down thrust attack that has some animation that goes below the feet when landing, so the bottom of the actor is not the bottom of their hitbox. This causes them to walk right through the slope rather than following it, and you have to jump to get the bottom of the actor to connect, which causes them to walk along the slope in mid-air.

Luyren

  • *
  • Posts: 2747
One of the behaviors from that pack involved in this whole process let's you customize the "bottom" of the actor for each animation individually when standing on semi-solids (which in this case would include the slopes), that could solve it if I understood it correctly. Just to be on the safe side: one thing you have to make sure regardless of what approach you use, is that all the animations for your actor should have the same dimensions.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Galdon2004

  • *
  • Posts: 313
Ah, yeah that works. Thanks.