How to do Mario Spiny character movement?

I have a spider enemy that I’d like to have be able to walk on whatever surface it’d like…Is there a way to do this out of the box? Or would it have to require some C++ custom movement applying force in the direction of the normal the enemy creature is standing on.

I think you can do this using Line Trace.

Have one pointing relatively forward from the character’s middle. When it hits something, it reports back a Hit Result which contains the outward-facing angle of the surface it hit, which you can use to calculate a new angle for the creature to rotate himself toward.

You’ll want another trace going relatively downward from in front of the creature’s face, to detect when he runs out of surface. When he does, trace AGAIN from the point where he misses his step into empty space, backward toward a space relatively below him (when I say “relative” I mean not true downward or true forward, but those directions from the creature’s eye viewpoint). This will collide with the corner hes coming around onto, like when he climbs up over the top of the pipe in your picture.

So you have three use cases:

  1. Bump forward into a surface and mount it
  2. Run out of surface and double back to a space under where his feet are trying to go, and mount that instead.
    If that doesn’t find a surface within the short trace distance of the creature’s body width (or maybe less), then the creature must have fallen off or the object he was walking on was remove. Make him fall until he lands on the ground and then start walking again.
  3. Still got surface in front of him, but not bumping into anything: Keep walking forward normally at whatever angle is your current surface.

let me know if my idea worked :slight_smile: