Editing Nameplates?

General support.
Post Reply
User avatar
turtleneckflex
Contributor
Contributor
Posts: 20
Joined: Mon Jun 29, 2020 11:41 pm

Thu Jul 16, 2020 11:53 pm

Hi hope everyone is doing well,

In free for all, I am trying to find a way to have all nameplates for bots and players be shown to everyone in the game. And in team death match, have the nameplate colors correlate to the team color.

By default it is set so you can only see the nameplates of your teammates while playing team death match.
I would also have to apply some sort of static variable to the walls and nameplates so you cannot see the nameplates of the enemy's through walls.

I know it's a lot to ask but if anyone could at least point me to the right scripts or the right lines of code where i can start working on this that would be very helpful.

thanks for the support.
User avatar
Lovatto
Admin
Admin
Posts: 1549
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Fri Jul 17, 2020 2:19 am

I'll point you to the code that you should look at:
In free for all, I am trying to find a way to have all nameplates for bots and players be shown to everyone in the game
Check bl_PlayerNetwork.cs -> Enemy() -> there you have that line:

Code: Select all

 DrawName.enabled = bl_RoomMenu.Instance.SpectatorMode;
add some conditions to enable or disable the name plate for FFA, like :

Code: Select all

if(GetGameMode == GameMode.FFA){ DrawName.enabled = true; }else{...}
have the nameplate colors correlate to the team color
That has to be done in bl_NamePlateDrawer.cs -> OnGUI() -> You can set the UI Color with GUI.color = Color;
you can get the team color of the local player with:

Code: Select all

bl_PhotonNetwork.LocalPlayer.GetPlayerTeam().GetTeamColor();
so you cannot see the nameplates of the enemy's through walls
I don't know why would you need a static variable for that, but to be able to do this you will have to detect when the enemy players are not visible for the local player camera with Raycast, Mesh bounds encapsulation, custom occlusion, etc... and enable or disable the Name Plate according to.
User avatar
turtleneckflex
Contributor
Contributor
Posts: 20
Joined: Mon Jun 29, 2020 11:41 pm

Fri Jul 17, 2020 8:40 pm

this helps a ton, thanks for the support
Post Reply