I can't make the camera rotate around the player...
I want to make a "PSX Survival Horror", and a need a good camera system. I've already figured out how to make a "CCTV/Resident Evil" camera, but i can't figure out how to make a "Camera follow position/rotation" script, theres a sample of what i've already wrote: It can make the camera follow the player smoothly, but can't rotate around the player...
using UnityEngine; public class camerafollow : MonoBehaviour { public Transform target; public float smoothPositionSpeed = 10f; public float smoothRotationSpeed = 40f; public Vector3 positionOffset; public Vector3 angleOffset; void FixedUpdate(){ Vector3 desiredPosition = target.position + positionOffset; Vector3 smoothedPossition = Vector3.Lerp (transform.position, desiredPosition, smoothPositionSpeed * Time.deltaTime); transform.position = smoothedPossition; Vector3 desiredAngle = target.position; Vector3 smoothedAngle = Vector3.Lerp (transform.position, desiredAngle, smoothRotationSpeed * Time.time); transform.RotateAround (target.transform.position, smoothedAngle, Time.deltaTime); } }
(sorry for the poor writing, english isn't my primary language).
Your answer
Follow this Question
Related Questions
How to add animations to character ? 0 Answers
disable gameobject after rotation limit 1 Answer
stealth Frezz when "hit&" play bttn 1 Answer
Scripting Error 0 Answers
Hello, i have question about the CarControler script 0 Answers