I'm trying to do my game and I was able to put a title scene but I would like to know if it is possible for me to put into it a logo of my website and put a link for players to go to my website?
Unity has a function called OpenURL that will open up a webpage - you can see it's Scripting Reference page here.
You could easily incorporate this function into a custom Action, that gets called when you click on a Menu Button (see this tutorial). Alternatively, you could place it in a script inside a public function, and then call that function by using the Object: Send message Action.
I'm still trying to make that work but I'm just not able to do the first option. And for the alternative one, I don't understand what I should do. Also, would it be opening a new window in the browser?
Do you thing you could guide me please?
Do you think it would be possible to integrate such option in a future update?
Thing is, there's no end to what people may want for there own game - which is why custom Actions exist. They make it very simple to integrate custom features such as this into your AC game, but the code itself is a separate issue, and not one inherent to AC.
I'm confident that you could get the code you need (or at least help with it) by asking on the Unity forums. Once you know what code you want to call from AC, write back here with it and I can help you link it into your AC game.
OK - replace void Start() with "ublic void Interact(), and the link with your own website's link.
Place the script as a component on an empty GameObject named Site, and you can then use the Object: Send message Action to run this function whenever you like. Set the Object to affect as Site, and the Message to send as Interact, and the link will open when this Action is run.
You would have to post the whole message for me to be able to give a proper answer, along with the relevant code that it's referencing (the console will tell you which lines in which scripts are causing the problem).
Generally though it means you're causing a never-ending loop to run, causing a crash. Does your ActionList only call the "Interact" message just the once?
I meant "public" rather than "ublic" above - sorry, just saw that mistake.
But I cannot find the option to Run the actionlist in it's inspector and I have a message on top stating that there's no MonoBehaviour in the file, or their names do not match the file name...
I'll need to see a screenshot of that message in full.
What version of AC are you using? The ability to run ActionLists manually was added some time ago - it should be to the right of the "Expand all" / "Collapse all" buttons near the top.
Comments
You could easily incorporate this function into a custom Action, that gets called when you click on a Menu Button (see this tutorial). Alternatively, you could place it in a script inside a public function, and then call that function by using the Object: Send message Action.
I'm confident that you could get the code you need (or at least help with it) by asking on the Unity forums. Once you know what code you want to call from AC, write back here with it and I can help you link it into your AC game.
Place the script as a component on an empty GameObject named Site, and you can then use the Object: Send message Action to run this function whenever you like. Set the Object to affect as Site, and the Message to send as Interact, and the link will open when this Action is run.
Hi Chris,
I tried the script and I get this error message from the console :
StackOverflowException
Do you happen to know what that means?
Generally though it means you're causing a never-ending loop to run, causing a crash. Does your ActionList only call the "Interact" message just the once?
I meant "public" rather than "ublic" above - sorry, just saw that mistake.
What version of AC are you using? The ability to run ActionLists manually was added some time ago - it should be to the right of the "Expand all" / "Collapse all" buttons near the top.