Im using the original fps controller script, first question, should i use that?
Second question, how would i implement a “Charge Jump” Into that script?
here is a script thanks to static_cast.
private float jumpStrength = 0f;
void OnGUI()
{
if(GUI.Button(YOURBUTTONSTUFFHERE))
{
jumpStrength += Time.deltaTime;
if(jumpStrength >= 200)
Jump();
}
else
{
if(jumpStrength > 0)
Jump();
}
}
void Jump()
{
jumpStrength = 0f;
//JUMP CODE HERE
}
Just to clarify, i dont want a button on screen, i just want to be able to charge my space bar.