reverted last change partly (cam), added animation

This commit is contained in:
TAASONI3
2023-12-27 12:36:09 +01:00
parent 0865eee42f
commit 02a20443c2
16 changed files with 1169 additions and 137 deletions

View File

@@ -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;