Levitation Blueprint - Unreal Engine 5
This project example made in Unreal 5 showcases Blueprint scripting to interact with objects in the scene. In this case, the player can grab and levitate an object and make it fall if the interaction is stopped. Below, you can see how it’s made.
The interaction is made through a blueprint interface and involves a player character that draws line traces to query what is in front. If the actor implements the interface, the interaction occurs.Here’s some other examples with different behaviors.
The levitation logic basically turns the gravity off when the actor is grabbed and a null component is spawned, then attached to serve as an anchor for transformations. Random movements in the actor when levitating are made with a simple event timer to send small impulses to the staticmesh component of the actor. When the interaction stops, a signal is sent to switch on the gravity and detach the actor from the null component. Below, you can see the Event Graph for the examples above.
Download this project and see for yourself over here!