For a project I am working on, I wanted to have the player be able to run through a loop. The project itself is a 2d sidescroller so I would only have to worry about the one axis direction wise.
I currently have a setup that changes the characters rotation to match the surface angle, but it does not work on anything past 90 degrees and anything thatll make the player upside down. They simply treat it like a wall and run into it or slide off.
In short, is there a way using blueprinting to have a 2d character run perfectly through a loop? Without them falling off due to speed.
Use a spline component that represents your loop path. Instead of letting physics drive the movement, you can stick your character to the spline & move them along it using Get Location & Rotation at Distance Along Spline. That keeps them aligned to the loop, even upside down.
You can dynamically switch between spline-controlled movement & regular platforming when near the loop entrance or exit.
I heard something like this, is there anywhere I can look to get started?
Hey,
Here are some tutorials that provide visual guidance:
Hey there @KadenKitsune! Welcome back to the community! I agree with SRS here in recommending a spline, one note to add is that the basic Character class isn’t really built have it’s capsule rotate around or gravity direction changes, so the spline based movement is necessary for this if you aren’t using a custom pawn.
stock character is built around Z up so past 90 deg it fights you and slides off. on 5.4 and newer set gravity direction on the movement component and rotate the capsule to match the loop normal each tick, and open up walkable floor angle so upside down still counts as floor. drive it by surface normal from a line trace, not by spline, so entry and exit blend back to normal walking.
you can also try Gravity and Ballistics Toolkit, a gravity toolkit for Unreal Engine that handles characters on walls and loops with alignment built in: Gravity & Ballistics Toolkit — Planet Gravity, Zero-G & Arc Prediction | Fab