I have been stumped and I don’t know how to fix the following problems with the code
- CS1041: Identifier expected
- CS1525: Unexpected symbol
(', expecting
)‘,,',
;’,[', or
=’
I am trying to get a bullet to disappear after colliding with something and can’t seem to get it.
I am very new to Unity and coding in general and would be greatly appreciated if someone can help me see my errors. Thanks
using UnityEngine;
using System.Collections;
public class Despawn : MonoBehaviour {
function OnCollisionEnter(other : Collision){
var despawnTime = 1;
yield WaitForSeconds(despawnTime);
Destroy(bullet);
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}