Fixed AI C# Script for final submission #283
|
@ -285,7 +285,7 @@ public class PlayerController : Script
|
||||||
{
|
{
|
||||||
if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING || currentState == RaccoonStates.IDLE)
|
if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING || currentState == RaccoonStates.IDLE)
|
||||||
{
|
{
|
||||||
if (Input.GetKey(Input.KeyCode.Space) && isGrounded && rb != null)
|
if (Input.GetKeyDown(Input.KeyCode.Space) && isGrounded && rb != null)
|
||||||
{
|
{
|
||||||
currentState = RaccoonStates.JUMP;
|
currentState = RaccoonStates.JUMP;
|
||||||
Vector3 v = rb.LinearVelocity;
|
Vector3 v = rb.LinearVelocity;
|
||||||
|
@ -304,7 +304,7 @@ public class PlayerController : Script
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isGrounded && rb != null && (rb.LinearVelocity.y < 0.0f || !Input.GetKey(Input.KeyCode.Space)))
|
if(!isGrounded && rb != null && (rb.LinearVelocity.y < 0.0f || Input.GetKeyUp(Input.KeyCode.Space)))
|
||||||
currentState = RaccoonStates.FALLING;
|
currentState = RaccoonStates.FALLING;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue