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,
|
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||||
type: 2}
|
type: 2}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 38.603355
|
value: 38.643215
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||||
type: 2}
|
type: 2}
|
||||||
|
|
|
@ -6,6 +6,8 @@ public class PlayerMovement : MonoBehaviour {
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
public float acceleration = 3;
|
public float acceleration = 3;
|
||||||
|
[SerializeField]
|
||||||
|
public float boost = 2;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
public float friction = 0.1f;
|
public float friction = 0.1f;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
|
@ -137,6 +139,8 @@ public class PlayerMovement : MonoBehaviour {
|
||||||
Vector3 acc = transform.up * acceleration;
|
Vector3 acc = transform.up * acceleration;
|
||||||
if (braking)
|
if (braking)
|
||||||
acc *= 0;
|
acc *= 0;
|
||||||
|
if (Input.GetAxis("Vertical") > 0)
|
||||||
|
acc *= boost;
|
||||||
rb.AddForce(acc);
|
rb.AddForce(acc);
|
||||||
}
|
}
|
||||||
{// Drag
|
{// Drag
|
||||||
|
|
Loading…
Add table
Reference in a new issue