I cant make gui button

I attached gui script to gui scene. I have a problem with sending a message to my score.gui_script because i cant find url to my score.gui-script. I send message from coin script. Coin script is situated in factory and i cant find the way to acces score.gui script.

If you need to find the url of a script and you can’t figure out the url yourself you can add print(msg.url()) in the init function of the script to see the url in the console.

I tried to write print(msg.url()) in gui_script and console show me DEBUG:SCRIPT: url: [:]

When i want to change my level through colection proxies, appear the same problem i cant acces the loader scrpt and appear message url: [].


Put it in an init() function.

You need to put print(msg.url()) in the init() function of a script, just as I wrote in my previous reply.

function init(self)
  print(msg.url())
end

i cant figure the main problem…

Now i made the url adress to my gui script and after that console gave me that error
Error when dispatching message to gui scene: -2. Message ‘set’ sent from default:/instance6#script to default:/ground/CompGui#gui.



Try a different name for the message. The engine has a set of names that are used internally, like “enable”, “disable”, “play_animation” etc and “set” might just be one of those.

Yes, that’s probably it! This really should be documented…

1 Like

I guess the x and y are not given.
try instead action.x and action.y