Trouble passing message between multiple gui scripts

Hi,

I’m having trouble when trying to pass a message between two GUI scripts in an object.

Here is the code that sends the message:

local function controls(self)
    msg.post("#controlsmk2", "show")
end

And here is the code that should receive the message:

function on_message(self, message_id, message, sender)
	if message_id == hash("show") then
		print("show")
	end

end

Here is my collection structure:

image

The calling function is definitely being called but there is no response upon the message being sent.

Many thanks

The code looks ok, but please check that you’ve attached the correct gui script to controlsmk2.gui. Also check the console for any errors.

1 Like

Yep that was it thanks! Completely glossed over that despite setting up multiple GUIs before.
Thanks!

1 Like