- Home /
How to sync child objects of a transform in multiplayer
Basically there is an object in my scene that needs other objects as children to work right, but when I tell the network view to track the parent object's transform, it doesn't track the children (just that they exist and are children of the parent object). I also need it do be so that any client can add an object as a child... and I just can't figure it out. Thanks for reading, and hopefully answering if you can :)
Answer by Bryan-Legend · Sep 08, 2015 at 09:35 PM
Apparently there's a new component called NetworkTransformChild in 5.2 for this.
See http://docs.unity3d.com/ScriptReference/Networking.NetworkTransformChild.html
Answer by winsjansen · Apr 07, 2015 at 09:22 AM
I'm not sure what your problem is, as if you add a networkVeiw to a parent it will send the transform of the parent over the network and move the parent at the other end and thus make the child follow it.
As for the client being able to add object as child, are you sure you are using Network.Instantiate?
what I'm trying to do is have all clients know what the children of a parent object is, assu$$anonymous$$g that the object starts with no children and the parent doesn't move. I basically just need each client to know that the child objects exist.
So you are saying that the other clients don't get the objects/childrens instantiated? If so, I'll need to see some code if you are certain that these objects are in fact insantiated through the network namespace!
Answer by wesleywh · Apr 07, 2015 at 07:12 PM
Ya this is a weird problem. Just make sure your adding a "NetworkView" component to the parent and dragging the transform to it. That will make jerky movement but make sure that works before moving on. If it watches that correctly it will move your entire object including the children of it.
Your answer
Follow this Question
Related Questions
Network animations 2 Answers
Is that any way to pass list of array through photon? 0 Answers
all parents of a transform 1 Answer
get bone path from transform 1 Answer