s key works (goes backward)
This commit is contained in:
parent
f851302a1f
commit
3a083bd291
|
@ -519,7 +519,7 @@ Transform:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 715590524}
|
m_GameObject: {fileID: 715590524}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 1, z: -26.47}
|
m_LocalPosition: {x: -15.88, y: 1, z: -16.65}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
@ -541,6 +541,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
rb: {fileID: 715590525}
|
rb: {fileID: 715590525}
|
||||||
forwardForce: 1000
|
forwardForce: 1000
|
||||||
|
sidewaysForce: 1000
|
||||||
--- !u!1 &811151746
|
--- !u!1 &811151746
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -9,6 +9,9 @@ public class PlayerMovement : MonoBehaviour
|
||||||
|
|
||||||
public float forwardForce = 1000f;
|
public float forwardForce = 1000f;
|
||||||
|
|
||||||
|
public float sidewaysForce = 1000f;
|
||||||
|
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
@ -21,5 +24,9 @@ public class PlayerMovement : MonoBehaviour
|
||||||
if (Input.GetKey("w")) {
|
if (Input.GetKey("w")) {
|
||||||
rb.AddForce(forwardForce * Time.deltaTime, 0, 0);
|
rb.AddForce(forwardForce * Time.deltaTime, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Input.GetKey ("s")) {
|
||||||
|
rb.AddForce(-forwardForce * Time.deltaTime, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue