- Home /
Unity - Dancing Ball World camera following and rotating system
Hello there,
I want to make a camera movement as smooth as this and I want it to rotate just like it: https://www.youtube.com/watch?v=Te59TzPf12o
And I don't really know how! Any ideas?
Thanks in advance
Answer by Chasmer · Sep 03, 2019 at 12:51 PM
Check the LookAt function (https://docs.unity3d.com/ScriptReference/Transform.LookAt.html). Just reference the GameObject you want to track and throw LookAt into the Update method. This would make the camera rotation and tracking. As for camera movement, I would create a class that contains bool if the movement is jump or not, float speed and Vector3 position. Then create a list of those objects and a coroutine that have access to it. Inside the coroutine iterate on that list and check if the object is a jump. If yes, simply move the camera to the position, if not use another coroutine to use lerp and move the camera smoothly to the desired position. Hope I helped a little, if I have time later today, I'll put the example code.
@Chasmer Thank you! But I've tried the LookAt function before, it is fine.. but I'm trying to make it look better like I want the camera to change the angle of view on the corners. Please help! thanks again.
Your answer
Follow this Question
Related Questions
Would anyone teach me how to create camera movement and look controls? 2 Answers
Cinemachine input axis camera movement,cinemachine input axis control with script 1 Answer
How to allow camera to complete an upside down rotation while using LookAt() 0 Answers