Hello
I’m working on my first 3D platformer (similar to INSIDE) and I would like to know how I can bind the camera to the mouse. So that it is attached to the player but at the same time follows the mouse.
Here is part of my script
void Update()
{
if (player)
{
int currentX = Mathf.RoundToInt(player.position.x);
lastX = Mathf.RoundToInt(player.position.x);
Vector3 target;
target = new Vector3(player.position.x - offset.x, player.position.y + offset.y, transform.position.z);
Vector3 currentPosition = Vector3.Lerp(transform.position, target, damping * Time.deltaTime);
transform.position = currentPosition;
}
}