child

An Actor can have child actors. The coordinates of the children are relative to the parent Actor.

Imagine we have a top-down view of a tank pointing to the right. It's world position is (300,300). The tank's position is a world coordinate. The tank has a child-Actor for the turret. Its position is relative to the tank. Let's suppose the turret is at position (10,0) (slightly forwards of the tank's center). The world position of the turret can be calculated as (310,300).

However, if the tank rotates by 90° anticlockwise (its now pointing up the screen). The turret's position is still (10,0) - it never changes, but the world coordinate can be calculated as (300,310).

Properties

Link copied to clipboard
Link copied to clipboard