Hello I'm a bit of a noob so go easy...
I'm trying to make a room escape game on unity, this is all I have so far...
For the first level shown above I just want to open the door when the mouse is looking at the door and the player clicks the left mouse button.
I've tried many times and different ways to do this but I cannot accomplish this :(
I have iTween Editor set up to play the animation of the door opening, which looks fine I just need a way of activating it to play the animation and load the next level once the door is opened.
I have this bit of code already, but its not much use...
Does anyone know how to make this work? Thanks in advance!
you could use a raycast method.
the door will need a collider : http://unity3d.com/support/documentation/Components/class-BoxCollider.html
then cast a ray (Raycast) : http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html
if the raycast hit the door, then play animation. (raycast video) : http://www.unity3dstudent.com/2010/08/intermediate-i01-raycasting/
then you could write something like this :