- Home /
Question by
TomatJuice · Jan 24, 2021 at 04:13 PM ·
2dnetworkingspritenetworksync
How to sync a sprite change to other clients?
In my game you can change what you are holding. I have tried to use a SyncVar and an integer to change the the sprite from a hook. I have also tried a ClientRPC. How can I update to changed sprite to other clients?
public void ChangeItemInHolder()
{
if (inventorySlots[selectSlotIndex].item == null)
{
itemHolder.sprite = null;
}
else
{
itemHolder.sprite = inventorySlots[selectSlotIndex].item.icon;
}
}
Here is the code from the hook of the syncvar.
Thank you in advance.
Comment
Your answer
Follow this Question
Related Questions
How to Sync a sprite change to other clients? 0 Answers
How can I make a smooth movement for sync transform 0 Answers
How To Sync Scale in UNET 2 Answers
How to avoid spawn delay on client? 0 Answers
Multiplayer objects isn't equals. 1 Answer