Hello everyone!
I need some help trying to change the input key of this java script so that it can use an alphabet key (a, b, c) instead of using a mouse key (Fire1, Fire2). Here is my code:
var projectile : Rigidbody;
var speed = 20;
function Update()
{
if( Input.GetButtonDown( “Fire3” ) )
{
var instantiatedProjectile : Rigidbody = Instantiate(
projectile, transform.position, transform.rotation );
instantiatedProjectile.velocity =
transform.TransformDirection( Vector3( 0, 0, speed ) );
}
}
What I was wondering was how do I change the “Fire3” key (which is the middle mouse button) to an alphabet key (a, b, c)? I have tried putting “a” instead of “Fire3” but then I get errors from Unity.
Thanks in advance for your help.