why is my jump script not working?
So I have this script set up that references another script to sense the character's current power level to check if flying is available instead of jumping, and now I can't jump OR fly. Here it is:
GameObject tempObj = GameObject.Find("Player");
scriptInstance = tempObj.GetComponent<PowerController>();
if (Input.GetKeyDown(KeyCode.Space))
{
if (scriptInstance.currentPower > 0)
moveDirection.y = flightSpeed;
else
moveDirection.y = jumpSpeed;
}
Comment