Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If selected entity is deleted, the editor crashes #534

Open
r41k0u opened this issue Jan 31, 2022 · 1 comment
Open

If selected entity is deleted, the editor crashes #534

r41k0u opened this issue Jan 31, 2022 · 1 comment
Assignees

Comments

@r41k0u
Copy link
Contributor

r41k0u commented Jan 31, 2022

No description provided.

@r41k0u r41k0u changed the title Make removeChild() (Class Scene) a deferred event If selected entity is deleted, the editor crashes Jan 31, 2022
@Bashar-Ahmed Bashar-Ahmed linked a pull request Feb 16, 2022 that will close this issue
@Bashar-Ahmed
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants