Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
4
Question by Joshua · Mar 02, 2011 at 03:48 AM · webplayerlinklinking

Open link in new tab from webplayer hosted on any site.

I've searched this site and the unity script reference, but when it comes to linking I can only find out how to either:

  • change the page the web player is on to an other (I want it in a new tab. No killing my game! :p)

  • get unity to give the web page a command and then script into the web page how to respond to this command (by opening a link in a new tab)

What I want is to upload my game to a site I have no control over, yet when you click on a certain button a specified url will be loaded in a new tab. Why is this so hard and why does it seem no one has answered this before? o.O or am I missing something obvious?

TL;DR: Game on not my site. Click button. Open url in new tab. Help! :D

Edit: Still no complete answer, am I going to have to start a bounty? =p

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

3 Replies

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

Answer by efge · Mar 02, 2011 at 09:46 PM

Try this:

Application.ExternalEval("window.open('http://www.google.com','_blank')");

(You have to disable pop-up blockers.)

Comment
Add comment · Show 7 · 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 efge · Mar 02, 2011 at 09:57 PM 1
Share

PS: works with every URL

avatar image Joshua · Mar 02, 2011 at 10:03 PM 0
Share

Thanks, but this is what joshua_gorge also suggested.

avatar image Joshua · Mar 02, 2011 at 10:03 PM 0
Share

I'm looking for a way to open things in a new tab, not a new window. But thanks for trying to help though! :D

avatar image efge · Mar 02, 2011 at 10:14 PM 1
Share

It opens a new tab (tested: Firefox on $$anonymous$$ac) and it is the complete http code.

avatar image Joshua · Mar 02, 2011 at 10:49 PM 1
Share

Oh you are absolutely right! $$anonymous$$y apologies, I didn't notice the '_blank'. Thanks again! :D

Show more comments
avatar image
2

Answer by JGeorge · Mar 02, 2011 at 04:11 AM

http://unity3d.com/support/documentation/ScriptReference/Application.OpenURL.html

I'm having trouble seeing what you are asking, but I think this will do what you need.

It opens a new tab within your default browser. The url it goes to is what you provide in the parameter.

Edit: Try this command: Application.ExternalEval("window.open('httpcodehere')");

Comment
Add comment · Show 5 · 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 Joshua · Mar 02, 2011 at 04:17 AM 0
Share

This opens an url in the current tab. That's exactly my problem.

avatar image Joshua · Mar 02, 2011 at 04:20 AM 0
Share

Let me try to be more clear: The game is player by the webplayer on a website. If I execute this command the website will be changed. That's the whole point of 'different tab' or pop-up of course.

avatar image Joshua · Mar 02, 2011 at 04:23 AM 0
Share

But thanks for trying to help! Just reread my comments and may have sounded a bit harsh, if so: that wasn't my intention. :)

avatar image JGeorge · Mar 02, 2011 at 05:06 AM 2
Share

Try this command:

Application.ExternalEval("window.open('httpcodehere')");

avatar image Joshua · Mar 02, 2011 at 03:50 PM 0
Share

Thanks a lot! Not a perfect solution, since this creates a pop-up (which will be blocked) ins$$anonymous$$d of a new tab, but at least it works! If you edit this into your main answer I'll change my -1 to a +1 :D right now it says "value to old to be changed, unless this answer is edited"

avatar image
1

Answer by by0log1c · Mar 02, 2011 at 04:40 AM

This really isn't the most interesting solution but if the page you are trying to access is your own. You could use the html/javascript to open the pop-up and load the game back. Resuming a game mid-play would require quite some trickery I guess.

Can't wait for actual working answers you guys got ;)

Comment
Add comment · Show 1 · 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 Joshua · Mar 02, 2011 at 01:47 PM 0
Share

:-) that's at least a little helpful. Thanks! Oh and seeing how this question is now 9hours old and still unanswered it would probably help if you'd up-vote the question so the bot bumps it up. ;)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity 3d WEB player dowload link is not working / broken,Unity 3d web player download link not working 0 Answers

linking floats 2 Answers

Where can I submit a unity designed website 0 Answers

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Deep Linking to specific Scene in Android build 0 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