I am attempting to create a mechanic where the player character is able to walk on both the walls and ceiling, similarly to the Dretch from Tremulous. To be extra clear, I do not mean wall-crawling or climbing, I mean the character literally stepping onto the wall/ceiling and walking on it no different to the floor.
Only problem is that I can’t find any tutorials for this, nor can I find any help anywhere else, so I’m going to ask here. How would I go about making this in UE5?
If it matters at all, I haven’t used a template for this, I created a Blank one and made the movement/camera movement from scratch (speaking of, I’m having a little problem there where the movement slows down drastically whenever I look up or down). I can also attach some pictures of the code if that will help anyone with understanding how to assist with my issue.
Hello @Beelzebub-Crump Welcome to forums!
Here are two tutorials that might help you achieve what you’re trying to do:
Freeform Wall Run Tutorial
In this first tutorial, all you need to do is avoid connecting the Off Wall pin (18:30) and skip the steps from 23:40 to 30:00. With those changes, the system should work just like in the reference video you shared, staying attached to walls or ceilings without detaching unless you decide to.
Unreal Spider Movement
And in this second one, it’s much closer to what you’re looking for, and the character is very similar to the one in the reference video
If you have any questions, feel free to ask on the forum!
Hope it helps!
I’m gonna try out the spider one, since that does seem the most fitting for what I’m trying to do. The player character is even meant to be a spider, so it fits really well. Thank you so much for the help!
for entities with CharacterMovementComponent you can do this with MovementComponent→SetGravityDirection() (in C++ has been there for a while, was accessible in Blueprint in 5.4)
the problems with this implementation that need to be addressed:
the default Input presumes gravity will always be -Z so you will need to manipulate the input Vector2D to be about the plane of movement, and even with just reprojection the default way to calculate the frame of reference for the input is based on the camera, so if the camera is upside down the controls are reversed (unless this is intended by you)
The Camera by default will not rotate about the X axis (therefore when the player is on the wall they are upright but horizontal to the camera, and when they are on the ceiling the character will be upside down relative to the Camera
this method is by default only available in the CharacterMovementComponent, so to have it apply to Pawns would require probably backporting the functionality to like FloatingPawnMovement probably in C++
If you were planning to have NPC entities, and wanted them to have NavMesh like behaviors, and also have arbitrary gravity, NavMesh by default only support SurfaceNormals less then 90 degrees from +Z, so that would require extending NavigationSystemV1 in C++
there is a plugin on Fab for “Dynamic Surface Navigation”(it is a paid plugin only, not affiliated, and diving into modification on NavigationSystemV1 are a big undertaking) that fixes a bit of this, but you will still need to address the input and Camera, both of which have solutions freely available.