it syas expected. insert a semicolan at the end were do i insert it??
pragma strict
var rotationSpeed = (100);
function Update ()
{ var rotation : float = Input.GetAxis ("Horizontal") rotationSpeed; rotation = Time.deltaTime; (AddRelativeTorque)(Vector3.back * rotation); }
Click on the error and see which line it's pointing towards. On another note, please use code formatter for posting code, there are so many problems with your code.
Answer by aditya · Nov 10, 2016 at 01:34 PM
remove parentheses from the value of rotationSpeed
var rotationSpeed = 100;
apply asterisk in this line
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
and i don't know what this line is trying to do
(AddRelativeTorque)(Vector3.back * rotation);
Well, he probably want to apply a torque to the rigidbody. The quick and dirty solution would be:
GetComponent(Rigidbody).AddRelativeTorque(Vector3.back * rotation);
Though it would be better to get the Rigidbody reference in Start and store it in a class variable.
Your answer
![](https://koobas.hobune.stream/wayback/20220612100406im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Keeps Crashing!!,One project keeps crashing 0 Answers
Import project on same Unity editor from collab errors 0 Answers
Error message in 3D game tutorial 0 Answers
I Keep Getting Error After Implementing AdMob IDK what it means 0 Answers
Object reference not set to an instance of an object with raycast2d 0 Answers