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?
Replace { } with () on rigidbody line
jarjarb
3
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;
}
}
}