Handle
Last updated
Was this helpful?
Last updated
Was this helpful?
The Handle is a class that acts as the for an object, meaning that it takes forces and then moves, rotates and scales the object you create it for; we give its value when subscribing an object to the and can be used to add forces to the object.
To subscribe an object to the Motion Manager, we have to invoke the subscribe method, and pass a Spring Data value for each property we want to change (position, rotation or scale).
The way this component works is by taking forces we apply to it, and then add them together with the values for the correct property, finally it applies the results to the correct game-object. The Handle itself does not have an update method, and thus the Motion Manager is in-charge of invoking all the handles’ updates.
Once you subscribe an object to the Motion Manager trough a component, that component gains access to a Handle, this can now be used to translate, rotate or even scale the object in question.
You can move an object every frame by using the following code: