- Home /
setting up mouse button
editor is saying the fire button isnt set up. im following code from a video/book.im very new to unity.
var speed = 3.0;
var crateprefab:Transform;
function Update() { if(Input.GetButtonDown("fire1")) { var crate = Instantiate(crateprefab,Transform.position,Quaternion.identity);
crate.Rigidbody.Addforce(Transform.forward *2000); }
}
Very similar to : http://answers.unity3d.com/questions/325771/error-with-learning-script.html
$$anonymous$$ay I suggest some helpful video's to compliment your other learning materials :
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/essential-skills/
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/beginner/
this is the YouTube link for the above as one playlist : http://www.youtube.com/watch?v=-oXYHNSmTxg&list=PL27B696FB515608D2&feature=plcp
$$anonymous$$ore tutorials :
the Unity Wiki : http://wiki.unity3d.com/index.php/Tutorials
A list of resources : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html
Answer by andytouch · Oct 01, 2012 at 02:13 PM
The default reference of left mouse-click is
Fire1
You need to capitalise the 'F' in "fire1".
Answer by s.a.m · Oct 01, 2012 at 03:02 PM
cheers mate actually finished a different script as i kept getting errors even after capitalizing the "f".
Hi There.
Please don't post comments as answers. Post comments by clicking the [add new comment] button, a window then open for you to type in. Answer fields are for answers only, as this is a knowledge base.
You can convert this answer to a comment (or just edit your original question), you'll also get a better chance of getting an actual answer if the main list shows none or one answer in blue =]
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
UnityEngine.Input.GetMouseButton(1)) issue 1 Answer
Using my variables 0 Answers