Skip to content

TransformComponent

TransformComponent

enable property writable

enable: bool

Whether this component is active

owner property

owner: Object

The Object that owns this component

rotation property writable

rotation: float

Rotation in radians

rotation_degrees property writable

rotation_degrees: float

Rotation in degrees. Equivalent to the rotation property converted to/from radians.

size property writable

size: Vector3

Scale of the object along each axis

world_position property writable

world_position: Vector3

World-space position of the object

add_child

add_child(obj: Object) -> Object

Add obj as a child of this component's owning Object

add_component

add_component(component_class: Any) -> typing.Any

Attach a new component of the given type to this component's owning Object.

Example
render = self.add_component(RenderComponent)

add_object

add_object(obj: Object, parent: Object = None) -> Object

Add a newly created Object to the scene, optionally parented to another Object

get_component

get_component(component_class: Any) -> typing.Any

Look up a component on this Object

get_owner

get_owner() -> Object

The Object that owns this component

has_component

has_component(component_class: Any) -> bool

Check whether this component's owning Object has a component of the given type

remove_component

remove_component(component_class: Any) -> None

Remove a component of the given type from this component's owning Object

remove_object

remove_object(obj: Object) -> None

Remove an object from the scene

set_enable

set_enable(arg0: bool) -> None

Set enable. See the enable property.

set_rotation

set_rotation(arg0: SupportsFloat | SupportsIndex) -> None

Set rotation (radians). See the rotation property.

set_rotation_degrees

set_rotation_degrees(arg0: SupportsFloat | SupportsIndex) -> None

Set rotation_degrees. See the rotation_degrees property.

set_size

set_size(arg0: Vector3) -> None

Set size. See the size property.

to_local_coordinates

to_local_coordinates(arg0: Vector3) -> None

Convert a world-space point into this object's local/model space

to_world_coordinates

to_world_coordinates(arg0: Vector3) -> None

Convert a local/model-space point into world space

update_world_position

update_world_position(arg0: Vector3) -> None

Set world_position. See the world_position property.