- Home /
Question by
zachypin · Jun 27, 2011 at 07:00 PM ·
syntax-errorcs0103
Component Call not recognizing boolean. User error?
So I have a JS making a call to a CS script using GetComponent.
JS:
var upbutton = false;
function Update ()
{
upbutton = GetComponent(UpButton);
upbutton.WasUpPressed();
Then there's the CS
CS:
public class UpButton : MonoBehaviour
{
bool upPressed = false;
void OnMouseDown()
{
upPressed = true;
}
bool WasUpPressed()
{
return upPressed;
}
}
Problem is that I get an error back saying:
" 'WasUpPressed' is not a member of 'boolean' "
Comment
Best Answer
Answer by Eric5h5 · Jun 27, 2011 at 07:05 PM
Indeed, WasUpPressed is not a member of boolean, it's a member of UpButton.
var upbutton : UpButton;
Your answer
