Rootex
Rootex copied to clipboard
If selected entity is deleted, the editor crashes
Script to Reproduce:
Hackathon = class("Hackathon")
function Hackathon:initialize(entity)
self.exports = {
variable = "Hello Rootex!"
}
end
function Hackathon:begin(entity)
print("hello")
self.mybox = RTX.Scene.CreateEmpty()
self.mybox.name = "MyBox"
self.mybox.entity:addDefaultComponent("TransformComponent")
self.mybox.entity:addDefaultComponent("ModelComponent")
self.mybox.entity:addDefaultComponent("BoxColliderComponent")
self.mybox.entity.boxCollider.sleepable = false
RTX.GetCurrentScene():addChild(self.mybox)
end
function Hackathon:update(entity, delta)
if RTX.Input.WasPressed("space") and #RTX.Scene.FindScenesByName("MyBox")==1 then
RTX.GetCurrentScene():removeChild(RTX.Scene.FindScenesByName("MyBox")[1])
end
end
function Hackathon:destroy(entity)
end
return Hackathon