Jump to content

Making GameObject "always ontop"


Recommended Posts

I am working on a mod to add extra location markers, like the CoM, CoT and CoL markers to the game. I have managed to import a mesh of my marker and add it to the game and draw it both the VAB and in flight. I want it to be drawn "always on top" of everthing else, so you can see where it is even if it behind or inside a part. I managed to do this by luck in the VAB by changing the GameObject's layer to match the same layer that the stock CoM etc use. However this does not work for in flight.

I have not clue what is going on here. I assume that something is set up in the VAB so that gameobjects in a certain layer are rendered that way, but what? What do I need to do be able to render my mesh the same way on flight? I am a complete noob with unity, and while reading the documentation over and over again is fascinating, I am not getting anywhere!

Link to comment
Share on other sites

To start an answer to my own question, this thread suggest that it is done using an extra camera. Does anyone know if there is an extra camera in the VAB? I am busy trying to find it using code, but it would be handy if someone else already knew about it...

Link to comment
Share on other sites

All sorted. It turns out that there is an extra camera in the VAB called markerCam that is used to render the markers. Hpwever this does not exist in flight. I have managed to render a marker in flight by adding an extra camera and setting up the layers appropriately. See here:

screenshot23.png

I created the camera in a nasty hacky way when I set up the part, but I guess really what I need to do is to set it up when the flight scene is initalised. Does anyone have any suggestions as to what I need to hook to set a new camera up in a flght scene?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...