Fixing Character On The Ground

Overview This page provides a way to fix objects on the ground by a constraint-based approach, a way you can more strictly control your character. Tutorials Suppose we have a cube floating in the a...

Updated over 1 year ago Edit Page Revisions

Overview

This page provides a way to fix objects on the ground by a constraint-based approach, a way you can more strictly control your character.

Tutorials

Suppose we have a cube floating in the air, and we want to fix it on the ground.

Ywj2.png

Firstly,let's create a new trace channel named "floor"; this can be done in the project setting.

Ywj4.png

Then we can attach a blueprint to the cube

Ywj1.png

Here we cast a ray from cube to a location far below the cube. Then the ray will collide with floor layer and return the information of the floor. Then we can get the location of the collision point. Then we set our cube's location to this point + the height of our object.

After finishing this, your object should attach to the ground now:

Ywj3.png

-ywj7931