Hello, Does anyone know how to trigger an URL link when a certain object is tapped during gameplay, like for example: 'Is Touched' node ->> goes to a URL we put in. I have the following setup: 'Is Touched' node ->> 'Script' node with Code: function init(){ } function start(){ } function update(dt){ } function signal(name, value, sender){ if(name=="touch" && value) { log("Touch Confirmed"); // HERE CUSTOM CODE IS NEEDED TO TRIGGER A LINK WHEN AN OBJECT IS TAPPED OR PRESSED DURING GAMEPLAY } } function requested(name, arg, sender){ return this; } Anyone have an idea? The only closes solution in the API references is 'OnClick' --> https://www.buildbox.com/help/buildbox-3-api-reference/button/#onclick - but not sure if that can be utilized in this scenario. Thanks!
@itzonator Hey there, I've done that in this demo, each large screen you can see in the game can be touched and will open an external link (on Rarible in this case). It's pretty simple to achieve. To make it work you need to create UI URL Buttons and move them in a hidden position, like this: The setup is pretty simple: The 'Open Link' script has an attribute (Button Name), there you input the name of the button that the script will then look for in the UI and activate. Here's the content of the script: Code: function signal(name, value, sender, source){ if (value){ let buttonName = this.attribute('Button Name'); let button = this.ui().find(buttonName)[0]; button.activate(); } }
I found another way, to redirect to another UI and then using the URL button, it is an extra step, but works Thanks for your solution as well..