- Home /
semicolon problems
So i know this is a Frequently asked question but i just cant find a solution...
I have a small movement script(JS)
#pragma strict var rotationSpeed = 100;
function Update () {
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque {Vector3.back * rotation};
}
it just says to me Error UCE0001: ';' expected. Insert a semicolon at the end. Any help?
Answer by getyour411 · Feb 13, 2014 at 10:47 PM
Replace { } with () on rigidbody line
If you happen to see this again, please click Accept Solution to close this.
Answer by jarjarb · Feb 20, 2021 at 02:17 PM
Can you fix My problem
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class look : MonoBehaviour {
[Range(-90f, 90f)]
Quaternion rotation;
int Xrotate = 0;
[SerializeField]
KeyCode up;
[SerializeField]
KeyCode down;
// Update is called once per frame
void Update()
{
if (Input.GetKey(up) && Xrotate > -90)
{
transform.Rotate(-2f, 0f, 0f);
int Xrotate - 2;
}
if (Input.GetKey(down) && Xrotate < 90)
{
transform.Rotate(2f, 0f, 0f);
int Xrotate + 2;
}
}
}
Your answer
Follow this Question
Related Questions
Script error about the semicolon. 1 Answer
UCE0001: ';' expected. There is one there? 1 Answer
Please insert semi colon... WHAT!?! 2 Answers
insert semicolon error 3 Answers