NetworkTransform and parent scaled to 0

I have an object with a NetworkTransform, which has some children at different localPositions also with NetworkTransforms. The parent is scaled to 0,0,0.

The problem is, when I scale the parent back to 1,1,1, the children on the clients are all at position zero. Is there a way to prevent this?

How were the children parented? In-scene placed, spawned prefab, or individually spawned and moved to new parent?

Do the children have NetworkObjects too?

1 Like

It’s the same behaviour both when it’s in scene and when prefab. The children are not spawned/reparented and they have their own NetworkTransforms

could you post Inspector screenshots of the parent and child network transforms?

1 Like

Parent:

Children:

Try setting the parent networktransform to use world space. Or both. Or the opposite: child in world space.

I had issues with this combo and overriding the same sync values in the child, eventually I settled to synchronizing the child myself with a netvar since it was only the up/down look rotation (head follows firstperson view).

1 Like

I can’t, it’s used in an AR multiplayer project and for all the users the world space position would be different, everything has to be in local space for localization purposes

Not sure I understand these implications, or how this relates to localization (as in language, not position).

I assume this means the prefab is also parented to different, client-specific network objects?

Maybe you can’t prevent the scale change but you could send an RPC when you scale, so that the owner(s) can reset their scale values to be 1,1,1 again. You could also unparent the child temporarily, apply scale, and reparent to see if that makes any difference.

Also it may be worthwhile to reconstruct this setup in a non-networked scene just to see if scaling the parent has the same effect on its children. If so, there must be an explanation for this behaviour. For instance when you drag a 1,1,1 scaled object to a parent that’s 2,2,2 scaled, the dragged child will change its scale to .5,.5,.5. But when the parent’s scale is 0,0,0 this may somehow affect the child positions due to “0 times something equals zero”. Just a hunch. It may make a difference to scale to 0.00001 instead of flat 0s, you could give that a try too.

We are using image tracking to align content between different AR headsets - so if I unparent anything and it becomes in world space, it will be in different position for every user, because for every user the zero point of the scene is in a different place (where their headset was when the app was started), so that is not an option((( Scaling not to 0, but to 0.01f also doesn’t help - the positions are at 0.00007 instead of 0.07, for example, when it’s scaled up.

Important thing to point out - everything works as intended on the server, it’s only happening on the clients. And it’s impossible to apply scale on the clients, since it requires changing ownership, which is not possible when there are many clients at the same time.