Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
The properties that are added to the component are the basic parameters that we use to customize the circular motion of the component.
RotateToFaceOutwards specifies whether the component will orient to face away from the center of rotation on every update. RotationSpeed is the number of degrees the component rotates every second.
OrbitDistance indicates the distance that the components that rotate must be moved from the origin. CurrentValue is the current rotation position in degrees.
Inside our constructor, we establish some sane defaults for our new component.
In the TickComponent function, we calculate the location and rotation of our component.
The formula in the next step requires our angles to be expressed in radians ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access