Netcode + UCC V3

Piyush

Member
Hello @Justin Sir ❤️
Sir, I have been working on UCC + Netcode integration.
Sir, I have created this thread for some questions regarding UCC and it's script and bugs reports, so that i can clear all confusions and finish the netcode integration as soon as possible.
 
I have created world space canvas UI with attribute monitor and a crate with health attribute setup. I have added an image for quick look.
Problem is when i start the scene and spawn the character the attribute monitor script takes reference of the character (Player) and no longer stays on the reference which i have pre selected. (In case of crate character field needs to be null)

1724688294817.png

For example I will show the setup for a crate.

But i have actually done same for Characters (Players too) and under there prefab i have world space canvas for health, Now major problem is when host starts a game a player spawns which is fine
When client joins, the player of host at the client's end takes reference of clients player in attribute monitor.

I hope I have explained the situation well. Let me know if a video is needed.
1724688548986.png
 
Found Partial Fix to this problem Sir

1724689181521.png

Commenting this line in the code fixed the issue of not overwriting the attributeManager
But Character value is still being overwrite, Can't find where in the code it's overwriting that value
 
Unticking "attach to camera fixed" the problem for character value overwrite too Sir.

So i think the line i commented in the code could be a bug but I am not sure, so need to wait for your reply on this matter
 
Attach To Camera is fine, but you'll want to make sure on the CharacterHandler you do not automatically attach the player to the camera. Within the PUN integration I subclassed the CharacterHandler and only attach the camera when the character is a local character.
 
That line is ok - when the character changes the attribute manager should be set to null to reset it so it's prepared for a new character assignment.
 
Ohh okay Sir, then i will rework on the code as you suggested ❤️
Thank you so much Sir ❤️
I will let you know if i face more issues
 
Hello @Justin Sir,

Sir, any tips for spectator mode for UCC?
I have one idea -

I am thinking to connect other Player character & anchor value in camera controller script after my player dies.
That lets me see other player while he moves or performs abilities.
But problem is I still have camera controls so i can see in all directions even if player owner is looking in other direction. So, how can i stop my controls on the camera and read only the camera view from the player Owner?

Can you also help me/guide me how can i script this method, just a detailed overview will be enough then i can start scripting and test stuff and make sure keep testing until it works exactly how it should be.
 
For a spectator mode I wouldn't use the Ultimate Character Controller's Camera Controller component at all. This controller requires a player so you'll instead want to create your own spectator camera controller. You will want to disable the local player's camera controller when the spectator camera is active.
 
Hi @nathanj
I have successfully implemented spectator mode.

Thank you for suggestion :) But my game isn't using cinemachine and Tbh not a fan of cinemachine so had to do it without cinemachine

Here is Spectator mode in action -
 
Back
Top