Help needed: Access Netcode / NetworkTransnform by code

Hello!

I would like my server to be able to enable/disable syncing (position/rotation) according to some ingame events.

I am able to access Netcode/NetworkTransnform via inspector, but I don’t know how to do it ingame, by code.

Could you help me, please?

Thank you much!

using Unity.Netcode.Components;
At the start of the file, then:
put_object_here.GetComponent().SyncPositionX = false;
for example

1 Like