i am making a scripted way to block the player from being able to return to the previous room, i have it set up so that the celling collapses but i cant figure out what’s going wrong with the script ,`i’m new to c# can someone tell me what’s wrong with this code:
using UnityEngine;
using System.Collections;
public AudioClip rockfall;
public class trigger : MonoBehaviour{
void Awake()
GameObject go GameObject.find (FallingCellingC)
go.rigidbody.iskinematic = true
GameObject go GameObject.find (FallingCellingB)
go.rigidbody.iskinematic = true
GameObject go GameObject.find (FallingCellingA)
go.rigidbody.iskinematic = true
//GameObject go GmeObject.find (TrapEnter)
//GameObject go GmeObject.find (TrapEnter)
// Update is called once per frame
void Update () {
if OnTriggerEnter(Collider TrapEnter) = true{
GameObject go = GameObject.Find("FallingCellingC");
go.rigidbody.isKinematic = false;
AudioSource.PlayClipAtPoint(rockfall, Transform.Position);
else go.rigidbody.isKinematic = true;
}
if OnTriggerExit(Collider TrapEnter) = true{
GameObject go = GameObject.Find("FallingCellingB");
go.rigidbody.isKinematic = false;
AudioSource.PlayClipAtPoint(rockfall, Transform.Position);
else go.rigidbody.isKinematic = true;
}
if OnTriggerEnter(Collider TrapExit) = true{
GameObject go = GameObject.Find("FallingCellingA");
go.rigidbody.isKinematic = false;
AudioSource.PlayClipAtPoint(rockfall, Transform.Position);
else go.rigidbody.isKinematic = true;
}
}
}
this is an updated version of the code as of 1/10/2014 using what i have learned from you guys and gals comments, there is still something wrong and the commented lines at 19 and 22 are there because i thought i might need to tell the script where to find the triggers but was unsure if it was need or will be need