Hello there, community. I have been playing around with Unity3D for about a year now, and I've recently gotten really good at it. But it's only Unity3D itself I'm good at. I have been working on a game for a while, and now I need to add some enemies. I got an enemy script from a guy, it looks like this : var target : Transform; var moveSpeed = 3; var rotationSpeed = 3; var myTransform : Transform; function Awake(){ myTransform = transform; } function Start(){ target = GameObject.FindWithTag("Player".transform; } function Update () { var lookDir = target.position - myTransform.position; lookDir.y = 0; // zero the height difference myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(lookDir), rotationSpeed*Time.deltaTime); myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime; } So I create a .js file, and open it in Monodevelop. I'm then greeted with this : #pragmastrict functionStart () { } functionUpdate () { } I assume I should just replace this with the code I got and then save. But then, apparently there's an error. I tried everything. Does anyone know what I'm doing wrong?
If the code you posted is an exact copy and paste from the document that you have, the issue would be found within your start method - there is an unwanted semicolon in your GameObject looked call.