Cool, will definitely try this approach
Denys Shust
Creator of
Recent community posts
Please, unhook the camera from the player, make it smoothly follow the player.
The script for the Camera :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
[SerializeField] private Vector3 offset;
[SerializeField] private Transform target;
[SerializeField] private float translateSpeed;
[SerializeField] private float rotateSpeed;
private void FixedUpdate()
{
HandleRotation();
HandleTranslation();
}
private void HandleTranslation()
{
var targetPosition = target.TransformPoint(offset);
transform.position = Vector3.Lerp(transform.position, targetPosition, translateSpeed * Time.deltaTime);
}
private void HandleRotation()
{
var direction = target.position - transform.position;
var rotation = Quaternion.LookRotation(direction, Vector3.up);
transform.rotation = Quaternion.Lerp(transform.rotation, rotation, rotateSpeed * Time.deltaTime);
}
}
In TriJam`s HALL OF FAME the winner of 161 jam is Multiverse Runner, BUT when i look to real jam rating i saw, that the winner is I HOPE YOU LIKE PINK. The game Multiverse Runner is on the 5-th place... WTF ? :D