Skip to content

Playing within editor

Nako Sung edited this page Apr 26, 2016 · 10 revisions

To play with editor you must have an access to editor world.

Get the World

let editorWorld = Root.GetEngine().GetEditorWorld()

Creating an actor

let actor = new StaticMeshActor(editorWorld)
let cubeMesh = StaticMesh.Load('/Engine/BasicShapes/Cube')
actor.RootComponent.SetWorldLocation({Z:123})
actor.StaticMeshComponent.StaticMesh = cubeMesh

Function not being called

$execEditor( () => {
  // your code goes here to prevent exec-blocking
} )

Warning

Editor context is not being cleaned up before map load. So every references to actors belonging to previous map should be cleaned up before map load triggered.

Clone this wiki locally