Make jump speed a public variable
This commit is contained in:
@@ -7,6 +7,7 @@ public class FishController : MonoBehaviour
|
||||
{
|
||||
public float speed = 4f;
|
||||
public float gravity = -9.81f;
|
||||
public float jumpSpeed = 8;
|
||||
public Vector3 velocity;
|
||||
public Vector3 drag;
|
||||
|
||||
@@ -32,7 +33,7 @@ public class FishController : MonoBehaviour
|
||||
|
||||
if (Input.GetButtonDown("Jump") && controller.isGrounded)
|
||||
{
|
||||
velocity.y += 8;
|
||||
velocity.y += jumpSpeed;
|
||||
}
|
||||
|
||||
velocity.x = moveX * speed;
|
||||
@@ -43,7 +44,6 @@ public class FishController : MonoBehaviour
|
||||
|
||||
if (moveVelocity.y < 0 && Math.Abs(moveVelocity.y) < controller.minMoveDistance)
|
||||
{
|
||||
Debug.Log(String.Format("Abs velocity: {0}, controller.minMoveDistance: {1}", Math.Abs(moveVelocity.y), controller.minMoveDistance));
|
||||
moveVelocity.y = (gravity * 0.1f) * Time.deltaTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user