So the call for audio.play from the same if statement is working, however this line isn’t:
GameObject.Find("Computer Scare").GetComponent(Follow).speed - 2;
Even though its identicle to everything I’ve looked up, I cant seem to change the speed variable from the Follow script on the Computer Scare gameobject. I’m not really sure why, and any help would be greatly appricated, I’m pretty much desperate now. Thanks,
Here is that section of the script:
By the way, I’ve tried the stuff in // already
if (ammoamount > 0 && reloadTime < nextFireTime) {
ammoamount--;
nextFireTime = 0;
pistol.animation.Play("Shoot");
audio.Play();
if (hit.collider.gameObject.name == "Computer Scare"){
target.audio.Play();
//var speed = transform.Find("Computer Scare").GetComponent(Follow).speed;
GameObject.Find("Computer Scare").GetComponent(Follow).speed - 2;
//enemy.GetComponent.Speed = 1.6;
}
}
thanks again