I’ve not had a good chance to screw with blueprints, but here’s how I think I’d handle it (scripting wise)
First off the variables:
- bHang - Bool, toggles to true when a player touches a wall, toggles to false when the player leaves the wall, collides with the floor, or jumps off
- fHangTime - Float, determines the current time the player has hung from the wall
- fBeginSlide - Float, handles the amount of time before the player begins sliding
- fSlideRate - Float, handles the speed at which the player will slide, for the concept below we’ll assume the player will reach their max slide speed after 1 second, Slide rate should be negative (so long as you’re sliding down)
- vcWallNormal - Vector, store the walls outward facing if you want to add a wall jump functionality too
Now the premise:
If a player collides with the wall we want them to hang on, playing a certain animation (not sure how to handle that bit) before sliding down after a certain point.
Run a script like this every frame
To start we have, IF bHang is TRUE
This way the blueprint is only active if the bHang boolean is true (and the player is wall hanging)
Increase fHangTime by DeltaTime, time passed since previous frame (unsure as to the blueprint node to use for this)
IF fHangTime < fBeginSlide —> Set players velocity to 0, 0, 0, they’re still on the wall and haven’t begun sliding yet
ELSE —> Create a float for velocity equal to X, where X is fSlideRate * (fHangTime - fBeginSlide) OR fSlideRate, whichever is closest to 0 (remember negatives, also prevents players reaching insane slide speeds).
If all your walls are direct down then set player velocity to 0, 0, X, if not then some maths using wall normals will likely be required.
EXTRA: If the player hits Jump, apply force equal to ((vcWallNormal + (0,0,1)) / 2) * JumpForce and change bHang and fHangTime to FALSE and 0
Sorry if this makes no sense, I’m not fantastic at explaining things, this is the sort of proccess I’d use to handle it, simple, but it kinda works, does this help in any way, if not message me and I’ll make a flowchart or something to hopefully explain what I mean a bit better.