hi,
I guess your problem is the check.
You have said `if (Input.GetButtonDown ("TransformToSecond") && (currentEnergy == 100))`
i.e run this code till the time current energy is 100
and just below u are making it 0 so that is the problem
if (Input.GetButtonDown ("TransformToSecond") && (currentEnergy == 100))
{
Debug.Log("Q has been pressed");
playerToBeChangedFrom.SetActive (false);
playerChangingTo.SetActive(true);
currentEnergy = 0;
}
Write it at the end of the code as mentioned above.
Hope it helps.
↧