Syncing Equip/Unequip

atmuc

Member
I have AI characters. I manage all AI characters on the master. I use BD designer to equip/unequip weapons. The client shows aiming and firing animations without equipping the weapon. How can I sync equip events?

Master


1625828658573.png

Client
1625828693747.png
 
The Item Abilities are responsible for equipping so I would double check that the EquipUnequip ability is being started on the client.
I am not sure if it is related Ultimate Inventory System.
Are you using UIS? We have not been able to integrate PUN with the inventory system yet so this is likely to be a problem.
 
I think it is not related to UIS and PUN integration. I think it is related to script execution order problem. I guess; When Photon instantiate a prefab it enables game object after doing some network process. I have the same prefab on the both master and the client. It should equip 2 items on the client. I will examine UCC and UIS code.

1626098458349.png
 
How can I force inventory to load itemcollectionset? it does not load Equippable when the game object is instantiated by photon.
 
On the inventory you can call LoadDefaultLoadout. You shouldn't need to manually call this though so if you can reproduce it with the latest version of a fresh project I can take a look.
 
I reviewed UCC, UIS, and PUN integration codes. As I see I have to add all weapons as children of the character pun prefab's items game object. Because InventoryBase Start method does not run LoadDefaultLoadout for clients, My clients do not load weapons from UIS.

When I call CharacterInventoryBridge.LoadDefaultLoadout on the client I get "NullReferenceException: Object reference not set to an instance of an object" error for CharacterInventoryBridge.Equip-m_EquipUnequipAbilities because it is null at Start method (m_EquipUnequipAbilities = characterLocomotion.GetAbilities<EquipUnequip>();)

For multiplayer mode, Is equip ability disabled for the client?
 
Equip is used to the client. This does look like it's related to the inventory system integration and we haven't had a chance to add PUN support for it yet.
 
Top