Commit 6f169872 authored by Abdulrahman Mohammed's avatar Abdulrahman Mohammed

Fix some errors

parent 8859d67d
...@@ -37,6 +37,7 @@ namespace DavidJalbert ...@@ -37,6 +37,7 @@ namespace DavidJalbert
[SerializeField] float mouseSensitivity = 3f; [SerializeField] float mouseSensitivity = 3f;
float yaw; float yaw;
float pitch;
private void Start() private void Start()
{ {
...@@ -46,9 +47,11 @@ namespace DavidJalbert ...@@ -46,9 +47,11 @@ namespace DavidJalbert
private void Update() private void Update()
{ {
yaw += Input.GetAxis("Mouse X") * mouseSensitivity; yaw += Input.GetAxis("Mouse X") * mouseSensitivity;
pitch -= Input.GetAxis("Mouse Y") * mouseSensitivity;
} }
void FixedUpdate() void FixedUpdate()
{ {
pitch = Mathf.Clamp(pitch, -15, 15);
Vector3 followPosition = whatToFollow.position; Vector3 followPosition = whatToFollow.position;
Quaternion followRotation = whatToFollow.rotation; Quaternion followRotation = whatToFollow.rotation;
...@@ -61,7 +64,7 @@ namespace DavidJalbert ...@@ -61,7 +64,7 @@ namespace DavidJalbert
{ {
case CAMERA_MODE.ThirdPerson: case CAMERA_MODE.ThirdPerson:
//Vector3 rotationEuler = thirdPersonAngle + Vector3.up * followRotation.eulerAngles.y; //Vector3 rotationEuler = thirdPersonAngle + Vector3.up * followRotation.eulerAngles.y;
Vector3 rotationEuler = thirdPersonAngle + new Vector3(0, yaw, 0); Vector3 rotationEuler = thirdPersonAngle + new Vector3(pitch, yaw, 0);
targetPosition = followPosition; targetPosition = followPosition;
......
...@@ -9122,7 +9122,7 @@ AudioSource: ...@@ -9122,7 +9122,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -16603,7 +16603,7 @@ AudioSource: ...@@ -16603,7 +16603,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -18438,7 +18438,7 @@ GameObject: ...@@ -18438,7 +18438,7 @@ GameObject:
- component: {fileID: 932103000} - component: {fileID: 932103000}
- component: {fileID: 932103001} - component: {fileID: 932103001}
- component: {fileID: 932103002} - component: {fileID: 932103002}
m_Layer: 0 m_Layer: 14
m_Name: CarAirBagDetector m_Name: CarAirBagDetector
m_TagString: Player m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -30257,7 +30257,7 @@ GameObject: ...@@ -30257,7 +30257,7 @@ GameObject:
- component: {fileID: 1439467444} - component: {fileID: 1439467444}
- component: {fileID: 1439467447} - component: {fileID: 1439467447}
- component: {fileID: 1439467448} - component: {fileID: 1439467448}
m_Layer: 0 m_Layer: 14
m_Name: AirBag m_Name: AirBag
m_TagString: Player m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -32578,6 +32578,10 @@ PrefabInstance: ...@@ -32578,6 +32578,10 @@ PrefabInstance:
propertyPath: m_Radius propertyPath: m_Radius
value: 2 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6139803074794598792, guid: dfbcd7dcd39040547a387ce3da0e70f3, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6139803074794598792, guid: dfbcd7dcd39040547a387ce3da0e70f3, type: 3} - target: {fileID: 6139803074794598792, guid: dfbcd7dcd39040547a387ce3da0e70f3, type: 3}
propertyPath: m_Material propertyPath: m_Material
value: value:
...@@ -48554,7 +48558,7 @@ AudioSource: ...@@ -48554,7 +48558,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -51569,7 +51573,7 @@ AudioSource: ...@@ -51569,7 +51573,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -15623,7 +15623,7 @@ GameObject: ...@@ -15623,7 +15623,7 @@ GameObject:
- component: {fileID: 1013166955} - component: {fileID: 1013166955}
- component: {fileID: 1013166954} - component: {fileID: 1013166954}
- component: {fileID: 1013166953} - component: {fileID: 1013166953}
m_Layer: 9 m_Layer: 14
m_Name: AirBag m_Name: AirBag
m_TagString: Player m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -29132,7 +29132,7 @@ GameObject: ...@@ -29132,7 +29132,7 @@ GameObject:
- component: {fileID: 2034521061} - component: {fileID: 2034521061}
- component: {fileID: 2034521060} - component: {fileID: 2034521060}
- component: {fileID: 2034521059} - component: {fileID: 2034521059}
m_Layer: 0 m_Layer: 14
m_Name: CarAirBagDetector m_Name: CarAirBagDetector
m_TagString: Player m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -34441,7 +34441,7 @@ AudioSource: ...@@ -34441,7 +34441,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -37448,7 +37448,7 @@ AudioSource: ...@@ -37448,7 +37448,7 @@ AudioSource:
OutputAudioMixerGroup: {fileID: 0} OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 0 m_PlayOnAwake: 0
m_Volume: 1 m_Volume: 0.75
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment