Transform Class
/UnrealEngine.com/Temporary/SpatialMath
Variables
Variable
Type
Description
Scale
vector3
The scale of the Transform object.
Rotation
rotation
The rotation of the Transform object.
Translation
vector3
The location of the Transform object.
Examples
Example: Moving a Collectible to a random place
# Gets the location of the Collectible object
var Location : vector3 = Collectible.GetTransform().Translation
# Moves the location to a random place inside the boundaries of -100 to 100
var NewX: float = GetRandomFloat(-100.0, 100.0) + Location.X
var NewY: float = GetRandomFloat(-100.0, 100.0) + Location.Y
set Location = vector3{ X := NewX, Y := NewY, Z := Location.Z }
# Teleports the Collectible to the new location, and keep the rotation.
# It is placed inside a 'if' statement because it can fail.
if (Collectible.TeleportTo[Location, Collectible.GetTransform().Rotation]):
Collectible.RespawnForAll()
Collectible.Show()Last updated