I have my script called PlayerAnimations, and a script called ColliderTrigger1. Player animations is like this (javascript):
var parkour1 = false;
function Update ()
{
if (parkour1 == true)
{
animation.Play("parkour1")
}
}
and I want the script ColliderTrigger1 to do something like this:
//Get the parkour1 variable from script PlayerAnimations
function Update ()
{
if (Input.GetKey(KeyCode.G))
{
//parkour1 = true;
}
}
How would i do this. I want to access the variable from the script, then change it to true if player hits ‘G’. I just don’t understand how to get the variable from the script, then how to change it to true.