Untitled
unknown
plain_text
2 years ago
702 B
10
Indexable
public void Look(Vector2 lookAxis, float deltaTime)
{
if (canLookAway)
{
input = lookAxis;
float deltaMouseX = -input.x * sensitivity * deltaTime;
float deltaMouseY = -input.y * sensitivity * deltaTime;
_playerInput.x += deltaMouseX;
_playerInput.y += deltaMouseY;
_playerInput.x = Mathf.Clamp(_playerInput.x, -90f, 90f);
_playerInput.y = Mathf.Clamp(_playerInput.y, -90f, 90f);
_charAnimData.deltaAimInput = new Vector2(deltaMouseX, deltaMouseY);
Debug.Log(deltaMouseX);
transform.Rotate(Vector3.up * deltaMouseX);
}
}Editor is loading...
Leave a Comment