Hey, got myself a problem, "BCE0044: expecting (, found 'OnTriggerEnter'."
anyone got a clue how to solve this and I would be grateful.
this is the code:
var enemy: Transform;
var player: GameObject;
var dir: Vector3;
var speed: float;
var observed: boolean;
function update () {
if(observed) {
dir = player.position = transform.position;
dir = dir.normalized;
transform.Translate(dir * speed, Space.World);
}
else {
transform.eulerAngles.y = Mathf.PingPong(Time.time*20,90) -45;
}
function OnTriggerEnter (other:Collider) {
if(player) observed = true;
}
Thanx!
Yeah, that's why I prefer the Allman style. IMHO you can spot a missing bracket much easier. http://en.wikipedia.org/wiki/Indent_style#Allman_style_.28bsd_in_Emacs.29
– Bunny83Heheh, you could try downloading a good editor. Visual Studio would've caught that for you in no time...
– CHPedersen