Blueprint Rotating Movement Component
Overview In UE3 we were able to make rotating actors through creating Mover (Interpactor) and adjusting it's Rotation Rate parameters. In UE4 it can be done via Rotating Movement Component in bluep...
Overview
In UE3 we were able to make rotating actors through creating Mover (Interpactor) and adjusting it's Rotation Rate parameters.
In UE4 it can be done via Rotating Movement Component in blueprint.
Blueprint example
Create a new blueprint from Actor class.
Open Components tab and add:
- Rotating Movement Component
- Static Mesh Component (Movable)
Select Rotating Movement Component and look at Details panel. Here you can see its parameters.
Rotation Rate - rotator, which specifies rotation speed in degrees per second.
Pivot Translation - vector, which specifies rotation pivot local offset.
Rotation in Local Space - boolean, which specifies is rotation in local or world space.
Open Graph tab -> Construction Script
Create next editable variables:
- Rotation Rate (Rotator)
- Pivot Translation (Vector)
- Rotation in Local Space (Bool)
- Mesh (Static Mesh)
So, for now we need to setup blueprint to change mesh and adjust rotation parameters when it is already in level.
Drag and drop Static Mesh (component) and Mesh (variable) one by one into Construction Script graph selecting Get.
Drag Static Mesh (component) pin and find Set Static Mesh node.
Using Set Static Mesh node and Mesh (variable) set new mesh into Static Mesh Component
Now, get Rotating Movement component, drag its pin and find Set functions for its variables - Rotation Rate, Pivot Translation, Rotation in Local Space.
And using early created correspond variables set new parameters for rotating movement.
Compile and save blueprint. Place it in your level, select and look at Details panel. Here you can find and adjust all parameters we told about.
On this simple preview mesh you can see how it works in comparison with old system.
X = Roll
Y = Pitch
Z = Yaw