Heres my code i made sure that SpaceCoreInArea is 1 and yet it does not say “work” when i jump!
#pragma strict
function Start () {
}
function Update () {
if(PlayerInArea.SpaceCoreInArea == 1 && Input.GetKeyUp (KeyCode.Space)){
Debug.Log("Works");
}
}
What is PlayerInArea.SpaceCoreInArea, and where is it defined? Are you trying to access a script called SpaceCoreInArea attached to a GameObject called PlayerInArea? Or a variable called SpaceCoreInArea in a script called PlayerInArea? Or is this a custom object that you’ve created somewhere?
I suggest you read http://docs.unity3d.com/Documentation/Manual/ControllingGameObjectsComponents.html because it sounds a lot like you’re not sure how to access components via script.