Hello.
Could someone point me in the right direction to implementing the impact of player speed when moving through foliage/bushes?
I would like the player to move slower when walking though bushes.
Any help or suggestions are welcomed.
Thank you.
Here’s some examples from my project where I do exactly that:
1: tracing for the current physical material. I check if it equals certain ones then call a special event. (you dont necessarily need custom events, I just do it as precautionary in case I want to add some additional logic later)
Here is the actual trace. Just shooting a line down from character.
Adjusting a float which is used to adjust movement speed in the “adjust movement speed” function.
However you want to adjust speed. I like to just use a multiplier.
Collision with instanced foliage as well, if you want that. Just be sure overlap is enabled on the instances.
Finally, setting up landscape layers and physical materials is easy but has a few steps involved. Lookup “footsteps from landscape layer” on youtube and you’ll find plenty of quick examples.
2 Likes
Greatly appreciate the response. Fairly new to using UE. I will most likely work with collision with instanced foliage. Could you give me some insight. Is that a Blueprint that I would apply to foliage collision? I am practicing on Megascans foliage.
Sorry I did not see your response.
All of this code is happening on my player pawn.
It goes like this:
- Player capsule collision detects an overlap.
- It looks at the overlap actor and checks the class to see if its instanced foliage.
- If so, then fire off the events to adjust the character movement components max walk speed variable.
What you will need to do on the megascans foliage is make sure it’s collision is set to overlap. You don’t need to do that on every static mesh - rather do it in the instanced static mesh parameters (if you either used the foliage paint tool, or procedural foliage spawners)