Log in or register to post comments

touch 3D Object call a website

November 3, 2013 - 3:02pm #1

I need when a 3D object is touch, it call a website page. Here is the code, but does not work. I would like a help.

 

using UnityEngine;
using System.Collections;
 
public class com : MonoBehaviour {
 
void Update ()
{
if (Input.GetKeyDown ("escape"))
Application.Quit ();
 
TapSelect ();
}
 
void TapSelect ()
{
foreach (Touch touch in Input.touches)
{
if (touch.phase == TouchPhase.Began)
{
Ray ray = Camera.main.ScreenPointToRay (touch.position);
RaycastHit hit;
if (Physics.Raycast (ray, out hit))
{
Application.OpenURL (hit.collider.gameObject.name);
Debug.Log (hit.collider.gameObject.name);
}
}
}
}
 
}

 

touch 3D Object call a website

August 11, 2019 - 7:51am #16

I am trying to do this with augmented reality. I would like to open a website when I touch the object, however, I was unsuccessful in my attempts.

Can you help me make an android application with this function?

I can make the phone show the object in reality, but only until then. When I touch the object nothing happens.

I am a complete beginner and do not understand much of this world, I found a script that said open the website, dragged it to my object, but it did not work.

My email

touch 3D Object call a website

December 8, 2013 - 7:42am #15

Hello popows86;

 

sorry to bother you. I'm also very interested about your script.
My email :

 

Best regards

 

Laurent
 

touch 3D Object call a website

November 17, 2013 - 7:21am #14

Hello popows86 

can you send the example to my email too?

i try to make 3D with URL too...

Thank you...

touch 3D Object call a website

November 13, 2013 - 1:33pm #13

How can do to, when is touch (tap) the PLANE with the .jpg  then dissapear again.?

 

touch 3D Object call a website

November 13, 2013 - 2:29am #12

HI I could diffently also use the code :-)

my email is

Daniel@simulacrum.dk

Best Regards

Daniel

touch 3D Object call a website

November 11, 2013 - 12:10am #11

No problem, send it.

touch 3D Object call a website

November 10, 2013 - 6:41pm #10

I would like to get your code because I have the same problem, Would you send it to my email please?

javierovalle@yahoo.com

Thank you very much!

touch 3D Object call a website

November 10, 2013 - 11:36am #9

Send it

 

Enjoy

touch 3D Object call a website

November 10, 2013 - 10:18am #8

Same, I would love to have this example

morris.myself@gmail.com

 

Thanks

Momay

touch 3D Object call a website

November 5, 2013 - 8:01am #7

Send it

touch 3D Object call a website

November 5, 2013 - 7:56am #6

Hi popovvs86, i am looking for similar example 

can you please send me sample code at

 

touch 3D Object call a website

November 4, 2013 - 11:53am #5

nabilfx@gmail.com

touch 3D Object call a website

November 4, 2013 - 11:44am #4

Ok, give me your email and i"ll send you example.

touch 3D Object call a website

November 4, 2013 - 11:17am #3

Hi, i did but still does not work. I reaaly would like a help, thanks

touch 3D Object call a website

November 4, 2013 - 1:55am #2

Think this line is wrong: 

Application.OpenURL (hit.collider.gameObject.name);

Try this:

Application.OpenURL ("https://www.facebook.com");

 

 

 

If does not work in your script, it will be easier for me to throw you a source with all the necessary scripts to load the webpage when a 3D object is tap.

 

Let me know if this is needed.

Log in or register to post comments