hello. my goal is to simply switch from a MENU collection to a collection of another level with a mouse click. I can’t do it. I just keep it the way it was. menu. I’ve read the documentation and tutorials many times, but the tips haven’t helped. Please help me.
You should unload the menu collection as well as loading the ‘bedroom’ collection otherwise the menu will remain active.
if message_id == hash("load_bedroom") then
msg.post("/go1#menu", "unload")
msg.post("/go1#bedroom", "load")
end
You need to provide more info.
What happens?
Does it output anything?
Now there’s not even a menu.
That is expected, as you just added code to unload it?
I want to go to another bedroom level with a mouse click.
bootstrap on main.colection
but when I turn on the game, I can’t switch to the bedroom level with a mouse click.
At this point, it’s just easier if you share the project itself.
Zip up the project and share it here (don’t include the build or .git folders)
looks like it yes, although we don’t recommend including the build folder, as it tends to be large.
Should I send you a new one or will you check the previous one?
It looks like a valid project, and hopefully someone can take a look soon.
(I’m currently occupied, only answering between compilations)
You did not acquire input focus in your controller.script.
function init(self)
msg.post("/go1#menu", "load")
-- you forgot this:
msg.post(".", "acquire_input_focus")
end
This means two things:
- You will not be able to detect the touch/click event that you have in your on_input() function in the controller.script
- The menu and bedroom collections will not be able to acquire input focus since the “parent” (controller.script) has no input focus.
oh my god, thank you so much! for some reason I didn’t notice that. thank you!!