Trying to change the "camera.transparencySortAxis" to a new vector3 in runtime. [SOLVED]
Title says it all. I am making a 2D game where the camera rotates and the player it moved based on AddRelativeForce. However this changes the Y axis and therefore the new 5.6 sorting group which is so nice gets all messed up.
My idea was to change the:
camera.transparencySortAxis = new Vector3(**insert vectors based on players position**);
however this does not work.
any ideas? This feature is relatively new so I cannot find information on how to do this anywhere.
Answer by SteenPetersen · May 02, 2017 at 06:46 PM
Fixed this:
Documentation is a bit poor:
Although it says there that you need to type in:
GraphicsSettings.transparencySortAxis
it does not mention that you need to add:
using UnityEngine.Rendering;
at the top. I will remember to look for that in the future. Hope this helps someone.
Thank you, this is something their documentation appallingly lacks.
However, I'm still not seeing the variable. Nor have I seen it under Camera, which other posts recommend. This appears to be an old feature, so it should be in my version (5.4). Is it a Pro version variable perhaps?
$$anonymous$$y instance is trying to get transparent objects to render in their proper Z depth order. Currently they render behind everything with or without transparencySort$$anonymous$$ode = Ortho. If you have any ideas on how to resolve that, I'd appreciate it.
Your answer
Follow this Question
Related Questions
Transparency sorting using separate camera 0 Answers
Fragment shader shows alpha, surface shader doesn't 0 Answers
Problem with transparency of an object 0 Answers
how to hide objects inside an invisible object? 0 Answers
Glass shader turn white when double sided!? Am i misunderstanding somethig??? 1 Answer