x


Parsing Error

using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour {
    public Transform target;
    public int moveSpeed;
    public int rotationSpeed;

    // Use this for initialization 
    void Start () {
          GameObject go = GameObject.FindGameObjectWithTag("Player");
          target = go.transform;
    }

    // Update is called once per frame
    void Update () {
          Debug.DrawLine(target.position, myTransform.position, Color.yellow);

          //Look At Target
          myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);

          //Move Towards Target
          myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
    }

It's on the line after //Move Towards Target myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;

more ▼

asked Aug 04, 2011 at 12:21 PM

PaulBrasfield gravatar image

PaulBrasfield
56 15 14 15

I have a problem too it's also a parsing problem in unity can you help me i'm a beginner so i'm not very smart at this area. i have error assets/testing.cs(17,9): error CS8025: Parsing error this is the code:

using UnityEngine; using System.Collections;

public class Testing : MonoBehaviour {

// Use this for initialization void Start () { }

// Update is called once per frame void Update () { if(Input.GetKeyUp(KeyCode.Space)) { gameObject.transform.up.y = +1 ; } } Thanks in advance Paul

PS: I'm Dutch so sorry if i have some write errors

Dec 08, 2013 at 12:36 PM paulonl
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You don't have a closing bracket for your class! (assuming this is the full code) You should try to provide more details about the error

more ▼

answered Aug 04, 2011 at 12:37 PM

Styn gravatar image

Styn
1 3 2 2

Ok, i added a closing bracket for my class but then I get an error that says "namespace can only contain types and namespace declarations " on lines 11 and 17 (the void Start and void Update lines)

Aug 04, 2011 at 12:51 PM PaulBrasfield

anyone? Please?

Aug 04, 2011 at 01:34 PM PaulBrasfield
(comments are locked)
10|3000 characters needed characters left

You need to have closing braces for your class and you need to declare myTransform.

more ▼

answered Aug 04, 2011 at 01:53 PM

dibonaj gravatar image

dibonaj
268 39 33 33

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x9874
x3542
x51

asked: Aug 04, 2011 at 12:21 PM

Seen: 7202 times

Last Updated: Dec 08, 2013 at 12:36 PM