C# - What i have to use to make all the players in a multiplayer match see a specific player (through walls, trees, etc...) that enter in a determined area?
I Tried to figured out this by myself, but i'm new in programming and in C# too, and i don't find any components or something else that can do what i want. What i have to use to do that? Collider? Raycast? Light? Cameras? It's like the Widowmaker (from Overwatch) Ultimate, she reveal everyone from enemy team and her team can see they too. Someone can help me with that? Thanks.
Answer by sparkzbarca · Jan 04, 2018 at 09:28 PM
https://unity3d.com/learn/tutorials/topics/2d-game-creation/sorting-layers
Sort layers basically determine the order in which things are drawn, the way it works is you draw the background first, then the foreground and the foreground being drawn over it naturally obscures the background basically.
But you can manually tell unity what order something is, should be. An example of this is a HUD.
so One thing you could do simply place the player object for the duration of that skill or whatever top of the render sort order just under the UI itself so it's drawn in front of all objects in the scene.
alternatively if you dont want the entire person rendered and you just want like a dot or something, you can attach a game object to view to the player character as a child. Have it normally be invisible but when activated this is an object that's render is way up, normlaly it doesnt matter because it's invisble so it renders way up but it's see through, but then when it's activated it goes opaque.
You could also try to do something with Unity's buiilt in GUI.
If you try to display it the same way you do health, that may work. Unity's User Interface stuff is already drawn last over everything and drawing the mesh or something there over top of the player's model may work.
Your answer
Follow this Question
Related Questions
Problem With a Multi-Jump C# script, robot 2d character controller 1 Answer
Keeping an NPC character in front of a player character. 0 Answers
Error messages with 2d character sprite flipping and movement. 1 Answer
FPS Character not moving in relation to direction/rotation 0 Answers
MoveTowards is curving for no reason 0 Answers