Verse Library verse

09 Origin

Creates entities, registers them to simulation, and configures local transforms and relative origins.

extracted-snippets/documentation/en-us/fortnite/transforms-in-scene-graph-in-unreal-editor-for-fortnite/09-origin.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/transforms-in-scene-graph-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/transforms-in-scene-graph-in-unreal-editor-for-fortnite.md
# Section:    Origin
MyEntity:entity = entity{}
MyOtherEntity:entity = entity{}
if (SimEntity := Entity.GetSimulationEntity[]):
SimEntity.AddEntities(array{MyEntity, MyOtherEntity})
MyEntity.SetLocalTransform(transform{Translation := vector3{Left := 100.0}})
# Construct an entity_origin object and set the new origin of MyEntity to MyOtherEntity
NewOrigin:entity_origin = entity_origin{Entity := MyOtherEntity}
MyEntity.SetOrigin(NewOrigin)
MyOtherEntity.SetLocalTransform(transform{Translation := vector3{Left := 100.0}})
MyOtherEntity.SetLocalTransform(transform{Translation := vector3{Left := 100.0}})

Comments

    Sign in to vote, comment, or suggest an edit. Sign in