working first person (somewhat) and better player movement

This commit is contained in:
logzinga 2023-02-10 10:59:39 +11:00
parent ec658080c6
commit f851302a1f
2 changed files with 30 additions and 14 deletions

View File

@ -218,7 +218,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &477755281 --- !u!1 &477755281
GameObject: GameObject:
@ -315,7 +315,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &705507993 --- !u!1 &705507993
GameObject: GameObject:
@ -409,7 +409,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &715590524 --- !u!1 &715590524
GameObject: GameObject:
@ -424,6 +424,7 @@ GameObject:
- component: {fileID: 715590527} - component: {fileID: 715590527}
- component: {fileID: 715590526} - component: {fileID: 715590526}
- component: {fileID: 715590525} - component: {fileID: 715590525}
- component: {fileID: 715590530}
m_Layer: 0 m_Layer: 0
m_Name: Player m_Name: Player
m_TagString: Player m_TagString: Player
@ -445,7 +446,7 @@ Rigidbody:
m_UseGravity: 1 m_UseGravity: 1
m_IsKinematic: 0 m_IsKinematic: 0
m_Interpolate: 0 m_Interpolate: 0
m_Constraints: 0 m_Constraints: 112
m_CollisionDetection: 0 m_CollisionDetection: 0
--- !u!65 &715590526 --- !u!65 &715590526
BoxCollider: BoxCollider:
@ -518,13 +519,28 @@ 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: -5.14} m_LocalPosition: {x: 0, y: 1, z: -26.47}
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:
- {fileID: 963194228}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &715590530
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 715590524}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7abe468bd4bb568659351bd3fdfd3a3c, type: 3}
m_Name:
m_EditorClassIdentifier:
rb: {fileID: 715590525}
forwardForce: 1000
--- !u!1 &811151746 --- !u!1 &811151746
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -620,7 +636,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 119.883, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 119.883, z: 0}
--- !u!1 &963194225 --- !u!1 &963194225
GameObject: GameObject:
@ -698,14 +714,14 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225} m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: -0, y: -0.9417428, z: -0, w: 0.33633393} m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalPosition: {x: 0, y: 0.5, z: 0}
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: []
m_Father: {fileID: 0} m_Father: {fileID: 715590529}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: -140.693, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!1 &1493043239 --- !u!1 &1493043239
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -801,5 +817,5 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -18,7 +18,7 @@ public class PlayerMovement : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void FixedUpdate() void FixedUpdate()
{ {
if (Input.GetKey("W")) { if (Input.GetKey("w")) {
rb.AddForce(forwardForce * Time.deltaTime, 0, 0); rb.AddForce(forwardForce * Time.deltaTime, 0, 0);
} }
} }