I need help about my coding in order to get bullets to come out of the gun here is the code but it says theres something wrong with it plz tell me
var Bullet : GameObject;
var Spawn : Transform;
function Update ()
{
if(Input.GetButtonDown[‘fire1’)){
fire[ ];
}
}
function fire()(
instancelate(Bullet.Spawn.Position.Spawn.Rotation);
}
if(Input.GetButtonDown['fire1')){
Wrong opening bracket. Use (.
Also, the button string is a string, not a character. Use " instead of ’ to enclose the button string.
fire[];
Wrong brackets. Use (.
instancelate(Bullet.Spawn.Position.Spawn.Rotation) ;
I think you meant Instantiate instead of instancelate (unless you actually created that function). Also, Bullet.Spawn.Position.Spawn.Rotation is invalid. I think you meant to call Instantiate(Bullet, Spawn.Position, Spawn.Rotation). Commas instead of periods.
I suggest you go read up some scripting tutorials before attempting to script.
It’s also bad form to post the exact same problem in more than one post.