HOW TO ROTATE THE CAMERA AROUND AN OBJECT IN UNITY (EASY TUTORIAL)

preview_player
Показать описание
In this video I show you how to rotate the camera around an object using the mouse in a way that makes sense. We will code a simple C# script to achieve that. Controlling the camera is something you have to do when programming any video game. There are many ways to do it, but I'm showing you the one I found works best for me. I hope you find it helpful!

Рекомендации по теме
Комментарии
Автор

You are an absolute god, tied and failed this exact problem for so long. You saved a very important school project of mine.

JohnCena-mvuy
Автор

YouTube needs more Unity tutorials like this. Emma Prats, thanks for the high-quality video! I liked and subscribed to your channel.

hnguyen
Автор

I tried to figure this problem out for two straight days before I found your video. Thank you so much for your solution!

JonExplainsStuff
Автор

Brilliant tutorial Emma! Clear, concise and very professional! Rather that just saying "just do this and this will happen" you're explaining exactly what the code does so the user knows what's going on and actually learns from your video so they can do it themselves! Subscribed!

RetroSam
Автор

Last time I tried to make this kind of camera I just gave up because I could get it to work no matter what I tried. Very good job!

AG-hfww
Автор

Nice there are a lot of people uploading high quality tutorials on Unity now. Good.

aadityakiran_s
Автор

The best implementation of this subject on youtube! Three years ago but still kicking ass! Thank you.

riddlesphinx
Автор

I loved it! I was looking for this everywhere and I could only use find complicated and overthinked solutions. Thanks!

hydewyvern
Автор

The Y on World Space helped me a lot with a similar problem, thanks a ton.

briansilva
Автор

One of the best tuts for a thing many of us spend hours trying to figure out many thanks

paulcrawley
Автор

Oh my, I was looking for a solution like this for hours, I am glad I found your video. Very straightforward and concise. Thanks!

felipeuchoa
Автор

1000 Likes from me.
i never found a solution before.
but you did it and its awesome.

tariq_khan_
Автор

A little change/update. If you put the 'cam.transform.position = target.position' before the if statements in Update, and 'cam.transform.Translate(new Vector3(0, 0, -10));' after the if statements, the camera will follow the object while it moves, and will only rotate when you click the mouse button.

dreadflint
Автор

Yay, this is the solution I was looking for, works very well, thank you so much!

robertoperez
Автор

Thank you very much! I had been searching for this, and only found various complex solutions creating circular paths for the camera with Mathf.cos and .sin. This is so much more straightforward! I guess you don't know what you don't know, so I'm glad to now know about RotateAround.

aledlewis
Автор

You are soo smart first you are very fast and second i completely understand your words. 🥰

taimigamedev
Автор

This was EXTREMELY helpful, thanks Emma

PriestessOfDada
Автор

I was looking for a week Finally I did that.

ashajain
Автор

I couldn't get this to work, but I appreciate the explanation nonetheless.

bigsmoke
Автор

First of all thank you for the video; concise and to the point!

QQ: the cam orbits around a static object. How can I also have it follow the object if it moves?

Diertstarr