I need help with this script, where are the errors?

I cant seem to find the errors in my script could someone point them out so I can fix them?

Code :

#pragma strict

var damageDelay = 3.0; 

var Spikes : boolean;

var Jab : AudioClip;

function Start () {


function Update () {

	if(InSpikes = true){
		yield WaitForSeconds(damageDelay);
			Health.HP = Health.HP - 1;

function OnTriggerEnter (){
InSpikes = true;

function OnTriggerExit (){
InSpikes = false;


In line 15 you should write:
if(InSpikes == true){ instead of if(InSpikes = true){
when you checking if something is true you should use ==
when you assign a value you use =

You declared the variable as “Spikes” and then refer to it in the rest of the script as “InSpikes”.
It should be inSpikes, because variables should start with lowercase letters.


if (inSpikes)

does the same thing as saying

if (inSpikes == true)


if (!inSpikes)

does the same thing as

if (inSpikes == false)