im trying to make a adventure game were you have a person with magic abilitys who goes around doing quest.
my problem is that ive made a script for the fireball shoot thing but when ever i play the game it says
‘script error: update() can not be a coroutine’ i dont know what that means so can someone help me please
heres my script:
var projectile : Rigidbody;
var speed = 20;
var Character : GameObject;
var FireballTime : int = 2;
function Update () {
if ( Input.GetButtonUp ("Fire1")) {
Character.animation.Play("fireball_cast");
yield WaitForSeconds( FireballTime);
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
Destroy (clone.gameObject, 3);
}}
thx in advanced