reverted last change partly (cam), added animation
This commit is contained in:
@@ -9,6 +9,11 @@ namespace Assets.Scripts.Player
|
||||
{
|
||||
UIHandler uihandler;
|
||||
GameObject interact;
|
||||
public float mouseSpeed = 100; //the sensibility
|
||||
public float controllerSpeed = 0.01f; //the sensibility
|
||||
float xMaxLimit = 45.0f;
|
||||
float xMinLimit = -45.0f;
|
||||
Vector2 rotation = Vector2.zero;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -42,6 +47,22 @@ namespace Assets.Scripts.Player
|
||||
return null;
|
||||
}
|
||||
|
||||
public void lookAround(Vector2 view, bool isController)
|
||||
{
|
||||
rotation.y += view.x;
|
||||
rotation.x += -view.y;
|
||||
rotation.x = Mathf.Clamp(rotation.x, xMinLimit, xMaxLimit);
|
||||
if (isController)
|
||||
{
|
||||
transform.eulerAngles = rotation * (controllerSpeed * Time.deltaTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.eulerAngles = rotation * mouseSpeed;
|
||||
//TODO: Look at camera movement -> Not rly smooth. Weird drag
|
||||
}
|
||||
}
|
||||
|
||||
void showInformation()
|
||||
{
|
||||
RaycastHit hit;
|
||||
|
||||
Reference in New Issue
Block a user