Introduced neon visuals
This commit is contained in:
@@ -9,6 +9,8 @@ public class PlayerController : MonoBehaviour
|
||||
public bool useController = false;
|
||||
public float rotationSpeed = 100;
|
||||
public float movementSpeed = 100;
|
||||
public float drag = 1;
|
||||
public float idleDrag = 2;
|
||||
public Rigidbody rb;
|
||||
public GameObject forceZone;
|
||||
public float boostSpeed = 0;
|
||||
@@ -38,6 +40,8 @@ public class PlayerController : MonoBehaviour
|
||||
float movementDirection = Input.GetAxis("Vertical" + this.playerNumber);
|
||||
float[] aiInput = new float[3];
|
||||
|
||||
this.rb.drag = this.idleDrag;
|
||||
|
||||
//Override any inputs if this instance is to be controlled by AI
|
||||
if (this.aiControlled)
|
||||
{
|
||||
@@ -66,13 +70,14 @@ public class PlayerController : MonoBehaviour
|
||||
//Forward
|
||||
if (movementDirection > 0)
|
||||
{
|
||||
this.rb.drag = this.drag;
|
||||
this.rb.AddRelativeForce(Vector3.forward * this.movementSpeed * Time.deltaTime, ForceMode.Impulse);
|
||||
}
|
||||
|
||||
//Zurück
|
||||
if (movementDirection < 0)
|
||||
{
|
||||
this.rb.AddRelativeForce(Vector3.back * this.movementSpeed / 3 * Time.deltaTime, ForceMode.Impulse);
|
||||
this.rb.AddRelativeForce(Vector3.back * this.movementSpeed / 2 * Time.deltaTime, ForceMode.Impulse);
|
||||
}
|
||||
|
||||
//Boost
|
||||
|
||||
Reference in New Issue
Block a user