Forum rules - please read before posting.

How to set up an outside link?

This is the last step before I upload for testing and I have no idea how to do this. I've got a "hints" section (menu) where I wanted to set up an outside link (button on menu) for a cheater video on Youtube. Any help would be greatly appreciated.

Comments

  • Opening a link isn't something done by AC, but is instead done through Unity's own OpenURL method:

    https://docs.unity3d.com/ScriptReference/Application.OpenURL.html

    This can be placed inside a function within a custom script, e.g.:

    public void OpenLink ()
    {
      Application.OpenURL ("http://unity3d.com/");
    }

    AC can then call that method (and in turn, have the link open), by using either the Object: Send message or Object: Call event Actions.
  • edited March 2018
    I couldn't get this to work since it's inside one of your menus (hints, using AC menu). I think I will just put the text there so they can copy and paste.
  • The menu's source will not matter - set the Button's Click type to Run Action List,  and then use either of the Actions I mentioned above.

    Since your Actions will be an asset file, you'll need to place the script above on a new GameObject, make it a prefab, and then have the Action refer to the prefab - not an object in the scene.
  • I did all that EXCEPT making it a prefab. I'll give that a try and thank you, I never would have thought of that as an issue. The walk-through is part of the fun so I'm excited to see if it works.
  • edited April 2018
    I could only get the Object:Call Event to work but I'm thankful it worked. It was confusing until I found another forum discussion. If someone is reading this, you need to write the script exactly as Chris typed it above, and then look for the call event called "Open Link" from the pulldowns in the Action Script. Thanks Chris!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.