Hi,
Is there a way to get a player’s elevation relative to the landscape disregarding any other actors they might be standing in/on (using Blueprints)?
UE 4.26.2
Thanks
Hi,
Is there a way to get a player’s elevation relative to the landscape disregarding any other actors they might be standing in/on (using Blueprints)?
UE 4.26.2
Thanks
you can shoot a raytrace down from character and get the rays length. Just check to make sure it hit the landscape.
Thanks a lot, it works great!
Just a quick explanation for anyone else.
We’re creating a new ray trace channel and setting it to ignore everything so that it doesn’t collide with houses or rocks, for example.
We’re setting the landscape to block the ray trace that we created (it’s saying hey I’m here).
In the Blueprint, we’re firing the ray trace in the channel that we created. Setting the starting point to the player’s position and the endpoint, far below the player’s position. Keep in mind that the player’s position is the middle of their capsule component.
Once the ray collides with the landscape, we’re getting the distance at which it did so from the starting point that we set (the player’s position).