- Home /
Speed indicator (Problem)
Hi guys what wrong or missing to my code? .. i add a speed indicator to race game . ang i habe 1 error
ERROR:
UnassignedReferenceException: The variable myWC of 'Car' has not been assigned. You probably need to assign the myWC variable of the Car script in the inspector.
and this the line with error.
currentSpeed = (Mathf.PI*2*myWC.radius)*myWC.rpm*0/1000;
Pretty much what the error states..
The variable called "myWC" isn't assigned, meaning that it hasn't been set .. basically you probably have the following line somewhere
float myWC;
or something similar.. I'm assu$$anonymous$$g that you either forgot to set the value in the code or in the editor
tHAN$$anonymous$$S shadoX , but i already have assigned varibale for myWC . my probelm is theres something missing this code *0/1000 .. i dont if This sign (&) or equal sign (=) ..
what is the right in there two?
*&0/1000;
or
*=0/1000;
Thanks :)
What exactly are you trying to do ? Also, funny that I didn't notice it at first but
($$anonymous$$athf.PI*2*myWC.radius)*myWC.rpm*0/1000;
can't possibly work because you're trying to multiply something with 0... and then divide that with 1000
Your answer
Follow this Question
Related Questions
error with maxbackwardsSpeed 1 Answer
Unity FPS question 0 Answers
Sstop the car on reaching finished line [Problem 0 Answers
Syntax error: Instance required to access non static member 1 Answer
How to make rope more flexible? 0 Answers