Reworked camera handling to be smoother
This commit is contained in:
@@ -43,17 +43,9 @@ namespace Assets.Scripts.Player
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LookAround(Vector2 view, Vector2 speed)
|
||||
public void LookAround(float pitch)
|
||||
{
|
||||
if (transform.rotation.x <= -0.25)
|
||||
{
|
||||
if (view.y > 0) return;
|
||||
}
|
||||
if (transform.rotation.x >= 0.25)
|
||||
{
|
||||
if (view.y < 0) return;
|
||||
}
|
||||
transform.Rotate(Vector3.left, view.y * speed.y);
|
||||
transform.localRotation = Quaternion.Euler(pitch, 0f, 0f);
|
||||
}
|
||||
|
||||
void showInformation()
|
||||
|
||||
@@ -179,8 +179,8 @@ namespace Assets.Scripts.Player
|
||||
GameObject.Find("QuestLog").GetComponent<QuestLog>().updateQuests("explore", gameObject, 1);
|
||||
}
|
||||
|
||||
public void rotate(Vector2 input, Vector2 speed){
|
||||
transform.Rotate(Vector3.up, input.x * speed.x * 5);// * Time.deltaTime);
|
||||
public void rotate(float yaw){
|
||||
transform.rotation = Quaternion.Euler(0f, yaw, 0f);
|
||||
}
|
||||
|
||||
public void getRotation()
|
||||
|
||||
Reference in New Issue
Block a user