# 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: Construct an entity\_origin object and set the new origin of MyEntity to MyOtherEntity
MyEntity:entity = entity{}
if (SimEntity := Entity.GetSimulationEntity[]):
SimEntity.AddEntities(array{MyEntity})
if (OriginValue := MyEntity.GetOrigin[]):
# should not succeed
else:
# should fail, no transform_component on entity MyEntity
MyOtherEntity:entity = entity{}
if (SimEntity := Entity.GetSimulationEntity[]):
SimEntity.AddEntities(array{MyOtherEntity})
MyOtherEntity.SetLocalTransform(transform{})
if (MyOtherEntity.SetOrigin[MyEntity]):
# set entity origin succeeded
if (OriginValue := MyOtherEntity.GetOrigin[]):
# should succeed, MyOtherEntity has a tranform_component and has had the Origin field set with SetOrigin
# obtain the transform of the entity's origin object
OriginTransform:transform = OriginValue.GetTransform()
else:
# should not fail
Verse Library
verse
10 Construct An Entity Origin Object And Set The New
Safely gets and sets entity positions and rotation using optional transform values.
extracted-snippets/documentation/en-us/fortnite/transforms-in-scene-graph-in-unreal-editor-for-fortnite/10-construct-an-entity-origin-object-and-set-the-new-.verse