can you help mine please i’ve got the Assets/Scripts/script 2/bullet fire.js(13,34): BCE0044: unexpected char: 0xAD. error here what i put:
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed : float = 1000;
function Start() {
}
function Update(){
if(Input.GetButtonDown("Fire1"))
Fire();
}
function Fire(){
var Bullet1 : Rigidbody = Instantiate(Bullet,Spawn.postion,Spawn.rotation);
bullet1.AddForce(transform.forward*BulletSpeed);
}
The error tells you what is wrong. At line 13, 34th character
if(Input.GetButtonDown("Fire1"
Try using this. You forgot to add the end the ().
if(Input.GetButtonDown("Fire1"))
So altogether your script is this
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed : float = 1000;
function Start() {
}
function Update(){
if(Input.GetButtonDown("Fire1"))
Fire();
}
function Fire(){
var Bullet1 : Rigidbody = Instantiate(Bullet,Spawn.postion,Spawn.rotation);
bullet1.AddForce(transform.forward*BulletSpeed);
}