On Update
Last updated
Last updated
An 'On Update' event node is an animation node which will trigger an output event in every frame that a scene renders. The output value is recorded in delta seconds and it is the amount of time passed since the last frame. This allows control of time to trigger animations and control the advancements in every frame.
Control the Animation 'Rotate' using the 'on update' animation event node. Also learn how to apply math logic, vectors and control the time frame by delta seconds for the animation.
Follow the steps below:
Add an asset (Car Model) into the scene and create node from object. Open the Actions and Events toggle icon, select the 'Car' object and click 'Create Node from Object'. The object node is created and appears on the 'Actions and Events' Design Canvas.
Add 'On update' event node on to the Design Canvas. Right-click on the Design Canvas, Navigate to Create>Animation/Time>On Update
Add 'Rotate' action node and connect the 'Car' object node to the 'Rotate' action node. Right-click on the Design Canvas, Navigate to Create> Move, Rotate,Scale>Rotate
Add 'Multiply' action node. Right-click on the Design Canvas, Navigate to Create>Math>Multiply
Add 'Vector' node 'Create from XYZ'. Right-click on the Design Canvas, Navigate to Create>Vector3>Create from XYZ A vector is a bundle of X,Y and Z axis where you can determine the values of the axis and this can be controlled by using a single connector line to an output action.
Connect the 'Car' object node to 'Rotate' action node
Connect the 'On Update' output node to the 'Start' input on the 'Rotate' action node
The 'Car' object rotates along the Y axis at a frame rate of 90 frames per second.
With the above, you can apply animations with a procedure instead of stacking them on the animation timeline.
Connect the 'On Update' delta seconds vector to the 'A axis', vector of the Multiply' action node
Connect the 'A*B' output vector to the 'Y axis' of the 'Create from XYZ' vector node
Connect the 'xyz' output vector to the 'Rotation' vetor of the 'Rotate Action Node'