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’ "