Moving actors
After an actor is added to your scene, either by placing it in the editor or by spawning it at runtime, you may want to move it to a different location or to rotate it. There are two approaches to this:
Directly set the new position and rotation on the actor
Simulate physics by adding the actor to the physics system with a dynamic or kinematic physics body.
Setting the transform on an actor
If your object should not neceserilly adhere to laws of physics, you can simply set the position and rotation using the actor's position and rotation properties. This will update the rendered transform of the object but it will not update it in the physics world. For that to happen, you also have to apply the actor's transform through the physics system.
In the example below, we have an actor with a rendered and physical representation given by the collision shape. On each frame, we update the actors position according to a speed and direction.
Last updated