Boosting
This commit is contained in:
parent
1db113f138
commit
eac05d6bfe
2 changed files with 5 additions and 1 deletions
|
@ -1543,7 +1543,7 @@ Prefab:
|
|||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||
type: 2}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 38.603355
|
||||
value: 38.643215
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||
type: 2}
|
||||
|
|
|
@ -7,6 +7,8 @@ public class PlayerMovement : MonoBehaviour {
|
|||
[SerializeField]
|
||||
public float acceleration = 3;
|
||||
[SerializeField]
|
||||
public float boost = 2;
|
||||
[SerializeField]
|
||||
public float friction = 0.1f;
|
||||
[SerializeField]
|
||||
public float turnSpeed = 2;
|
||||
|
@ -137,6 +139,8 @@ public class PlayerMovement : MonoBehaviour {
|
|||
Vector3 acc = transform.up * acceleration;
|
||||
if (braking)
|
||||
acc *= 0;
|
||||
if (Input.GetAxis("Vertical") > 0)
|
||||
acc *= boost;
|
||||
rb.AddForce(acc);
|
||||
}
|
||||
{// Drag
|
||||
|
|
Loading…
Add table
Reference in a new issue