I have a cockpit mesh centered on the camera, and it works pretty well, except for one thing. If I fly up to a planet just right, not only will I fly through the planet (not the problem I wan to solve right now), but the planet’s going to intersect the cockpit. How, having had no scripting experience, do I render an object in front of everything else like a weapon viewmodel?
it’s actually all explained fully just on the doc page
Documentation/Documentation/Components/class-Camera.html
(it uses a “weapon” example)
You will have to carefully learn how to use the clipping planes (start experimenting with them) whic hjust means how near/far the camera will see stuff.
You will have to carefully learn how to use two or more cameras (it’s not hard)
Then check out the “Depth Only” feature - all explained there
It’s a good example of how something seemingly simple in Unity, in fact you need quite a bit of info to do more real-world tasks. A good example is the physics system, where, in practice, you have to know about layer based physics to get anything real-world done.
Hope it helps