x


How To Read Error Messages CS1525

using UnityEngine; using System.Collections;

public class MoveAround02 : MonoBehaviour {

public float Movespeed = 10;
public float Rotatespeed = 20;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {        
        float Move.forward = Movespeed = Time.smoothDeltaTime = Input.GetAxis("Vertical");
        float Move.left = Movespeed = Time.smoothDeltaTime = Input.GetAxis("Horizontal");
        float Rotate = Rotatespeed = Time.smoothDeltaTime = Input.GetAxis("Horizontal");

        transform.Translate (Vector3.forward = Move.forward);
        //transform.Translate (Vector3.left = Move.left);
        transform.Rotate (Vector3.up = Rotate);
    }

}

more ▼

asked Apr 14 '11 at 10:03 AM

Tommy Ducati gravatar image

Tommy Ducati
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

MSDN DEFINITION

The compiler detected an invalid character in an expression.

You are assigning variables but that does not result in a parameter that can be passed

    transform.Translate (Vector3.forward = Move.forward);
  //transform.Translate (Vector3.left = Move.left);
    transform.Rotate (Vector3.up = Rotate);

A = B

means

put what's on the heap as B on the place where A is as well.

Rotate however is a method that is asking for a parameter, something with a value. You are giving it a task, not a value.

more ▼

answered Apr 14 '11 at 10:26 AM

Proclyon gravatar image

Proclyon
1.4k 10 13 32

(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:

x198
x17

asked: Apr 14 '11 at 10:03 AM

Seen: 603 times

Last Updated: Apr 14 '11 at 10:03 AM