Hi. I've just started messing around with Unity. I'm trying to get my camera to a) follow my player and b) on right click hold and drag, rotate the camera fully AROUND the player/object.
What kind of a script am I looking for to accomplish this?
Currently the most I can get is my camera following the player as it moves different directions.
Another problem: My model (Berserker fighter from Standard free assets) seems to fall over after pushing a directional movement button back and forth or for too long. I don't know why. lol
I've got a camera controller asset on the store that does what you want. Send me an email at firstname.lastname@example.org and I will send you a free voucher for it.
As far as falling over, it depends on what exactly you're doing that is causing it, but freezing one or two of the rigidbody rotation directions might be all you need to fix it. You just check a couple boxes in the inspector, see this link.
edit: can rotate camera around still character, moving camera causes character to move in direction camera is facing
Answer by aandril
@ Joe-Censored That's not quite what I'm looking for. I'm looking for movement like in the game Echo of Soul.
Answer by saeed_m
3 days ago
hi @aandril, base idea:
public bool rotating = true;
public GameObject target;
public Camera target2;
public float speed = 20.0f;
public Transform rotationCenter;
void Update ()
target2.transform.RotateAround(rotationCenter.position, Vector3.up, speed*Time.deltaTime);
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
5 People are following this question.
Keep camera horizontal with RotateAround
Getting a scrolling camera to orbit around a circular walkway, following the player?
Camera smoothing of a Child Camera
TPS Rotation Camera (similar to WoW or any other mmo)
Clamp Camera Angle not Working