- Home /
Center camera to an object programatically
Hai, i created a turn based strategy game in unity3d and i am posting in here because i wanted to ask you guys in this forum a question. How do i center the camera to an object? lets say i got 1 object which is circle, and another object which is cylinder and my camera is on third person view (i modify it on working view in unity3d, not in code). I want to center my camera to that cylinder when the turn of circle is 0.
Basically, when i click the object (cylinder), the camera centered in the center of that object.
How do i do that? Thanks
Answer by Panik.Studios · Nov 21, 2013 at 02:29 PM
Could you assign different camera to each object and write a code to only turn on the camera if selected, and if none are selected go back to main camera?
Or Have one camera that transforms to mouse position on mouse down
Modified Mouse look script
Sure my ideas suck, but it's something to consider while waiting for someone experienced to read your post. Good Luck with it ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613122414im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Unity C# Sockets? 2 Answers
Fog of War Explored Area Gray out / un-updated areas 0 Answers