- Home /
How do i lock the position of the camera above the player relative to the origin point?
I have a predicament.. I have my player as a basic sphere that rolls around a larger sphere which is the world. The camera is following the player and looks at the center of the planet so thats fine. the problem is that there comes a point where the camera clips through the world.. The player gameobject starts at the top of the world and when it reaches the bottom the camera is inside the world.. Please help..
Can you take screenshots showing your setup at the start and when the clipping occurred? (best as a sideview from sceneview with world, camera and player positions)
After about 4 hours of messing around with it i got a working version. It works after i found the differnece of both my player object and my world and then multiplied it by two. ((player.transform.position - world.transform.position) * 2) And i used this and transform.Lookat (Vector 3.zero) in Update to fix the cameras position. :D