- Home /
Question by
Game_Maker · Mar 17, 2014 at 01:59 PM ·
glitchsemicolon
No semicolon?!
Hey, so for some ungodly reason this code refuses to work. I am trying to get the output for a horizontal axis and all, but my problem lies within some possible glitch. My code is this:
public var range : float;
public var textOutPut : GUIText;
function Update ()
{
var h : float = Input.GetAxisRaw("Horizontal");
var xPos : float h * range;
textOutPut.text = "Value returned: " +h.ToString("F2");
}
Unity is telling me that I do not have a semi colon after the var xPos : float h range;* even though it is quite clearly there. What am I doing wrong here?
Comment
Answer by Professor Snake · Mar 17, 2014 at 02:00 PM
You forgot to add the equals sign.
var xPos : float h * range;
should be
var xPos : float = h * range;
Your answer
![](https://koobas.hobune.stream/wayback/20220613140446im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Holding mouse cause strange behaviour 0 Answers
Weird Scene View 'Glitching' 0 Answers
Weird Problem with Clock 3 Answers
GUI flickering on screen for certain GUI 0 Answers
Problem with dynamic camera script ( Super smash bros. ) 2 Answers