Hi all - new user here.
After reading the message passing section of the manual, I still have some issues when trying to post messages between different game objects.
My structure is as shown in the screenshot:
A collection named level, containing:
- a game object called “level_go”, that contains a script, where I want to receive a message.
- another collection, that represents a small numeric keyboard on screen. The logic is handled in the keypard.script, that detects key presses, animates the touched key and is supposed to post a message to the “level_go” object.
However, my addressing is wrong, resulting in no message getting sent.
I have tried:
msg.post("/level/level_go#script", "keypad_key_pressed",{key=keys[index+1],number=numeric})
error: Instance '/level/level_go' could not be found when dispatching message 'keypad_key_pressed' sent from main:/codebreaker/keypad/keys#keypad
msg.post("/level_go#script", "keypad_key_pressed",{key=keys[index+1],number=numeric})
Instance '/level_go' could not be found when dispatching message 'keypad_key_pressed' sent from main:/codebreaker/keypad/keys#keypad
msg.post("level/level_go#script", "keypad_key_pressed",{key=keys[index+1],number=numeric})
error: Instance '<unknown>' could not be found when dispatching message 'keypad_key_pressed' sent from main:/codebreaker/keypad/keys#keypad
msg.post("level:level_go#script", "keypad_key_pressed",{key=keys[index+1],number=numeric})
error: scripts/keypad.script:44: Could not send message 'keypad_key_pressed' from 'main:/codebreaker/keypad/keys#keypad' to 'level:level_go#script'
Apparently, there something here I’m not getting and I was hoping for an explanation to clear things out.