Create A Floating Material in Unreal Engine 5

I wanted to highlight something I thought was super cool inside Epic's Action RPG example of how they created a bobbing potion inside the material.

Epic's Action RPG sample project potion in game
Epic's Action RPG potion

Software Version: Unreal Engine 5.4.4 | 4.27

Looking at Epic's Action RPG I thought it was super interesting how they tackled the floating potions in the game. Instead of using a tick function or timeline, they did it all inside the material. Doing everything inside the material, I believe, puts all the computation onto the GPU.

To accomplish this feat the material uses the Time node along with Sine and Vector3 parameter. All three nodes used together along with some calculations can produce a result that can be plugged into the material's World Offset Position.

Unreal Engine 5 floating offset material nodes
Floating material

Changing values in the Velocity param can lead to the mesh moving at different rates and/or different directions.

Overall, I just thought this was an awesome method that I wanted to highlight and isolate. Using this technique can lead other unique material changes.

Unreal Engine 5 floating materials on display in the material playground
Floating materials inside the MaterialPlayground level
Loading...