Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

How i do fix this error? Assets/CameraController.cs(17,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement,Unity Scripts error

$
0
0
using System.Collections; using UnityEngine; public class CameraController : MonoBehaviour { public Transform sphere; void Update () { Rigidbody rigidbody = sphere.GetComponent(); Vector3 vector = new Vector3(0, 3f, -5f); float velocity = rigidbody.velocity.sqrMagnitude; vector = vector * (1f+velocity/25f); Vector3 newPosition = sphere.position + vector; transform.position - Vector3.Lerp(transform.position, newPosition, Time.deltaTime*2f); transform.LookAt(sphere); } } ,How i do fix this error Assets/CameraController.cs(17,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

Viewing all articles
Browse latest Browse all 2891

Trending Articles