Unity C# Tutorial : Open Url on Button Click

preview_player
Показать описание
Here is a short Unity 2019 tutorial in which I show how to open a Url in the default web browser on button click.

It can be done with a C# script in which the OpenUrl method of the Application class is used for a Url parameter.

I also use Textmesh Pro for the button text, because it offers the possibility to add an underline style to the text and to set the color to a bluetone so that the text can be stylized like a web link.

What you can do after that is to disable the button image, so that only the text is visible as Weblink, but the functionality of the button click is still available.

See my social profiles here

#Unity2019
#Unity
#CSharp
Рекомендации по теме
Комментарии
Автор

dude... THIS is how tutorial videos should be made. Greatfull

AlexandrosNs
Автор

Really nice from you to show the code in he first second of the video ! Fastest tutorial I've never done ! :D
Thanks a lot ♥

lejocarry
Автор

i figured it out in just a second! thank u very much❤

Skaski
Автор

Soooo sooo helpfull thanks bro, ,,, i sub + i liked that video and i'm ready to wach anything of your contents, cuz you are not scaming here, you do some real science... i was working on sorce code in unity and its 3 days look inside all the files trying to find the directory of the url button ( like " rate us " and " more game " ) but its simple i was looking trough the wrong way lol ... its my first work in unity ... thank you anyways bro ....

younesselkhoutayri
Автор

Thanks Jayanam! It worked perfect for me!
One question (from a newbie): would it be possible to make a 3D object seen from an image target, become a button that opens a URL?
Thanks again!

revolution
Автор

Yess now i can troll some people with a rick roll in my game

orangefelix
Автор

but how open an url into an Unity scene(app)?

mikeg
Автор

I did the same thing you did but the button opens two identical browser windows for some reason

theindiecrisp
Автор

I want to open an url in my game. I mean, I want to press "E" for opening a webpage, but this webpage will be on my game screen, as a game window. How can I do that, please answer

korayalkan
Автор

Ooo good job for this video!! It is Useful for me to make link to my website!

TheAverageLutfi
Автор

I prefer to use a string parameter on the Method to avoid the use of the string on the inspector of the script.

public void OpenUrl(string p_url)
{
Application.OpenUrl(p_url);
}

This way on the OnClick Button Event you pass directly the url

nitedev
Автор

Hey is there a way to make the application or game display the web page instead of opening browser?

yourlocalgamedev
Автор

Nice video. BTW, is it possible to open URL link on Unity with voice commands? Any hints would be very helpful.

abeda
Автор

Thanks Jayanam.. nice video.
Its work...
But I have a question:
This sample, I have try to build the apk for android, But it is not working in my android.
Could you help me please..🙏

native_clips
Автор

hey! thankyou for the tutorial. i want to try it for my application. but, how to go back to application after opened the web browser?? should we make a back button or just click close on the web browser or how?? thanks. hope you can help me :)

elviana
Автор

thanks for the nice tutorial, how to i modify this to open the url in a new tab?

shalsa
Автор

Can i ask a question please, can i do same and embed an html code instead of url, for example html code for facebook like button so that it is clickable directly to add a like on the facebook page related to that html code ..?
( same way we imbed html on websites i mean )

andrew-isac
Автор

Fantastic Bro!
But I have another question.. I want open a folder on android.. How can I use url??
Thanx in advance..

hologramsfunforever
Автор

Is it possible to open the url inside the application? You know what I mean bro ? Integrate maybe the browser inside the application, I don't know if is it possible? Thanks

elgrekko
Автор

can you make a video in enemy Ai solider ?

mikotv