Is there a way to enable/disable components and game objects in the editor? Sometimes I’d like to disable things and then reactivate them through code or other means. I know I can enable/disable in code with msg.post(".", "disable") but it would be nice to do it in the editor as well
I see that the gui elements has it, but I dont see it for normal game objects/components?
-- set_enabled.script
-- Enables/Disables component or game object on init or reload
go.property("target_url", msg.url("."))
go.property("enabled", true)
local function set_enabled(self)
if self.enabled == false then
msg.post(self.target_url, "disable")
end
end
function init(self) set_enabled(self) end
function on_reload(self) set_enabled(self) end
Just add it to any game object and set any target you want. By default it will affect the current game object.