- Home /
Play a video on clicking on an object
Hello guys, Im very new to learning Unity.I was wondering if anyone can help me, what I need to do is, when I click on a defined spot or object on my scene, I want to open a new window inside my scene and load a video player with a stop and play button and also an Exit (x) button which will bring me back to where I was before.Something like lets say a info video or animated text for a specific object, when the user clicks on it. Is this possible?
Thank you in advance
It is very possible. Read the scripting reference and you should be able to figure it out.
@DaveA: All the 'are we to generous?' in its own right... but that's no reason to be mean! And YES, pointing to the scripting reference of all places IS mean. That is a truly scary and fruitless place to start out! (I know, what I'm talking about! it's almost impossible to squeeze any information out of that dry bread when you don't come from some other scripting-background and know how to read what's written there!)
@paritparit: Try http://www.google.com/cse/home?cx=002470491425767499270:iugs1ezlsfq and search for GUI, On$$anonymous$$ouseDown, play video... Good Luck. Greetz, $$anonymous$$y.
Thank you very much $$anonymous$$y, I really appreciate your taking the time to reply to my answer!!! And yes I am actually gonna need a lot of good luck and even more google search about this. I have already searched a lot on different unity forums,on past replies and on youtube, but like you already said,I have zero scripting background which makes it even harder to make sense of what I read in different posts.
However, a kind answer is always appreciated, and even a "not so helpful" answer, like DaveA's is also appreciated.
About the "are so generous" topic, I fully understand the point there,and I can assure you that I did a lot of research before my posting the question, but...I guess no research is enought since I haven't figured out the way to do it yet.
Anyways, thank you guys for your time to reply to me, cheerzzzz :)
Tough love. If you know zero about scripting, it's not gonna get fed to you. You have to learn it. It's a process. This forum is about answering questions specific to Unity, mainly scripting. Some knowledge is required. And if advising someone to read a manual or use Google, ins$$anonymous$$d of waiting hours or days to get an answer they could find themselves is mean, then color me bad. I was new, long ago (1 year). I was often advised to google and read. It helped me grow for sure. If I relied on this forum to hand me all my answers I'd know just as much today as I did when I started.
@paritparit : see below
Yes DaveA, I fully understand what you're saying and I couldn't agree more.I already know that it is a process not easy to learn. I already know how it feels to be in the possition of actually knowing the answers to what newbies ask, but if I didn't have the time or the will to answer-help someone, I wouldn't tell them "just search and you will find". I mean, yes it is a response after all, but it isn't a helpful one,and there is not a point in answering to a question when you know you wont help anyone.You could just not answer,right? Well,at least that is how I feel.
Im glad to know that today you actually have learnt things useful to you.That is good for you. And,yes, like I already said, I know I have much search to make,but when people point out a link or a source where you can take a look is even better!!
Again,thank you DaveA for you time! :)
Answer by DaveA · Jul 16, 2011 at 12:02 AM
See the following, pretty much all you need is there:
http://unity3d.com/support/documentation/ScriptReference/Input-mousePosition.html
http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html?from=Input
http://unity3d.com/support/documentation/ScriptReference/MovieTexture.Play.html
http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html
http://unity3d.com/support/documentation/ScriptReference/GUI.Window.html
http://unity3d.com/support/documentation/ScriptReference/GUI.Button.html
Your answer
Follow this Question
Related Questions
Walking Animation 1 Answer
Play Animation and Stop Moving on Enemy Collision 1 Answer
Play animation when in collider and button pressed 1 Answer
Automatically playing animations 1 Answer
Animation problem in script 0 Answers