- Home /
Object in center, and the camera/player can rotate to view it in 360 degree
I want to put my object in center, and the player can view the object in 360 degree. the player/camera should lock in that place, which they can only view the object and unable to view other places. just like the image shown, the player/camera is not allow to run to other place, how can i made it? thanks
Answer by taxvi · Dec 09, 2014 at 09:00 AM
create an empty object and place it in the same position as the target object. attach a script to it where in the update function you always move this empty object in the same position as the target object. note that you'd rather use this method than making the empty object a child of the target because you don't want to rotate the empty object. then create a rotation script based on your inputs, let's say, if you press 'A' rotate the empty object left, press 'D' - rotate right. then move the camera in the position where you want it to be initially. at last, make the camera a child of the empty object.
Your answer
Follow this Question
Related Questions
How to create 360 degree video and add hotspot in 360 video in unity? 0 Answers
How to Camera Rotation when UI is up? 0 Answers
Change a float value with the horizontal axis? 1 Answer
Camera bounds 0 Answers