diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 20:14:07 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 20:14:07 -0400 |
| commit | b45cbdab7ba1217347fc67863cc9d3c90ef74bf9 (patch) | |
| tree | 71f650d9cb94b400af062cfe586d4703180c842a /Assets/Scripts/MouseLook.cs | |
| parent | 4653555cdef5a61817e35002fc371c0ca9830d45 (diff) | |
| download | Project-Sandbox-b45cbdab7ba1217347fc67863cc9d3c90ef74bf9.tar.gz Project-Sandbox-b45cbdab7ba1217347fc67863cc9d3c90ef74bf9.tar.bz2 Project-Sandbox-b45cbdab7ba1217347fc67863cc9d3c90ef74bf9.zip | |
Added watermark and colour to the player
Diffstat (limited to 'Assets/Scripts/MouseLook.cs')
| -rw-r--r-- | Assets/Scripts/MouseLook.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Assets/Scripts/MouseLook.cs b/Assets/Scripts/MouseLook.cs index 7f14427..f52f685 100644 --- a/Assets/Scripts/MouseLook.cs +++ b/Assets/Scripts/MouseLook.cs @@ -2,6 +2,11 @@ public class MouseLook : MonoBehaviour
{
+
+ public float mouseSensitivity = 100f;
+
+ public Transform playerBody;
+
// Start is called before the first frame update
void Start()
{
@@ -11,6 +16,11 @@ public class MouseLook : MonoBehaviour // Update is called once per frame
void Update()
{
+ float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
+ float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
+
+ playerBody.Rotate(Vector3.up * mouseX);
+
}
}
|
