Unity Netcode Pick up and Hold Script

57 views Asked by At

i was trying to make a script for picking up an object and holding it/carry it in unity networking. without networking i would just change the parent. this is not possible tho, i can only set a child to a networkobject. but the hand where i want to hold it doesn't have one, what is the best solution now?

i tried to do

currentHoldingItem.GetComponent<NetworkObject>().TrySetParent(holdTransform);

but i get an error saying InvalidParentException: Invalid parenting, NetworkObject moved under a non-NetworkObject

0

There are 0 answers