Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by fjam100 · Nov 27, 2010 at 01:20 AM · mouseobjectsurllinkput

How do I put a link to a website when I click with the mouse an object or word?

Thanks to "UnityWebPlayer" the game can be played from your browser. But I would like to put a link to a website when clicking on objects (Images, doors, words ...) Would it be possible to put a url when I click with the mouse?

Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

6 Replies

· Add your reply
  • Sort: 
avatar image
10
Best Answer

Answer by Eric5h5 · Nov 27, 2010 at 02:11 AM

Use Application.OpenURL. For the clicking part, that depends on what you're doing exactly, but using OnMouseDown is one pretty simple way.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fjam100 · Nov 27, 2010 at 02:29 AM 0
Share

Thanks, I'm interested in this code, but do not know how to put in the code "On$$anonymous$$ouseDown"

avatar image fjam100 · Nov 27, 2010 at 02:50 AM 0
Share

I think I have it.

Thank you very much has been helpful

avatar image SibochCZ · Dec 04, 2020 at 03:12 PM 0
Share

Thanks!!!!!

avatar image
1
Best Answer

Answer by oliver-jones · Nov 27, 2010 at 01:21 AM

You can find that info on here: file:///Applications/Unity/Documentation/ScriptReference/WWW.html

But you do this:

// Get the latest webcam shot from outside "Friday's" in Times Square var url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg"; function Start () { // Start a download of the given URL var www : WWW = new WWW (url);

 // Wait for download to complete
 yield www;

 // assign texture
 renderer.material.mainTexture = www.texture; 

}

This is example taken from Unity, showing you to retrieve info from websites. But you can manipulate into URL

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fjam100 · Nov 27, 2010 at 01:32 AM 0
Share

Thank you very much for answering

I see the picture but I do not know where to put the web address in the code.

avatar image oliver-jones · Nov 27, 2010 at 01:40 AM 0
Share

Where the var url is, change that in the "http://" to your specific website

avatar image fjam100 · Nov 27, 2010 at 02:32 AM 0
Share

Thank you very much

avatar image
2

Answer by prefix · Oct 13, 2017 at 02:47 PM

I have a short video on how to do this here Open URL

 public void OpenURLYouTube()
 {
     Application.OpenURL("paste your URL link in here");
 }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by rafaelzuckerberg · Apr 02, 2016 at 04:57 AM

you can do so: create one function:

// function of the button public void exampleFunction(string link){ Application.OpenURL (link); }

or :

// function of the button public void exampleFunction(){ Application.OpenURL ("www.exemplo.com"); }

now pass as parameter in your button or choose not pass parameter

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by mafanbong8819 · May 05, 2017 at 01:50 PM

Here, is the example of how to click the button then link to url, the step is clearly listed in this video. I hope this video is helpful to those need it too.

Click here for video, video - button to link

Here is the code.

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;

public class linkClick : MonoBehaviour {

 public void linkFunc()
 {
     Application.OpenURL ("http://www.google.com");
 }

}

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I attach objects like a picture? 2 Answers

3d Object attach to mouse 1 Answer

How to pick up an object using left mouse button 2 Answers

Build URL for app on GooglePlay and AppStore 0 Answers

Can I place a link (such as ) into the GUI.Label? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges