1
0
Fork 0
This commit is contained in:
Piegames 2018-04-24 16:06:43 +02:00
parent 1db113f138
commit eac05d6bfe
2 changed files with 5 additions and 1 deletions

View file

@ -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}

View file

@ -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