Make terrain slippery for character.

cjswanson1355

New member
I have been trying to figure this out for a couple weeks and i can't figure it out. I have seen it done in other, simpler engines, but need to know how to use it here. How do i make the floor slippery for my penguin friend? I want him to slide along the ground when he dives. I understand how to switch states but really don't see any settings for this.

penguin.PNG
 
First of all you'll need a way for the character to know what type of surface it's standing on. Unfortunately there's no out-of-the-box solution for the character to detect the specific ground object they're on, but it should be easy enough to do this yourself, e.g. by doing a small spherecast/raycast at the character's feet, or even just using trigger colliders around the specific areas of ground needed. You can then just manually set a state on the character with SetState, shown here: https://opsive.com/support/documentation/ultimate-character-controller/state-system/

Then for the actual slippery effect, it depends what you exactly mean by "slippery" really. You could increase the "Motor Slope Force Down" value on the character, which causes them to move more quickly when moving down slopes (as long as "Adjust Motor Force On Slope" is enabled. You can also of course increase the "Motor Damping" value to make them slide further before stopping.

You may also want to look into adding a custom physics material to your slope colliders and reduce its friction.
 
I'm not really worried about the type of game object. My intention is to have this as a penguin sliding ability where he moves down slopes. The "Slide" ability is kind of what i am looking for, but that's more for steep cliffs, and is very fast and takes control away from the character. i found motor dampening which slows down the character stopping. But how do i make the penguin, while standing still, slide down a slope? I assume i need to apply some type of force but i'm not sure where to look.
 
I was able to get it to sort of work by copying the Slide ability, renaming it as Dive, and changing some of the code. I'll try putting in a custom state and adjusting parameters and try to make it look good. The code doesn't really let me steer but I'll have to see how it handles with some adjustments.
 
Yeah in that case the Slide ability would be a good reference point, since it uses a raycast on the character's feet to check the slope and adds a force to the character accordingly. This kind of thing can take quite a bit of tweaking to get it to feel how you want!
 
Top