Open leozzyzheng opened 1 month ago
@leozzyzheng
The AnticipatedNetworkTransform component is a basic example of how to implement an anticipated transform.
We will look into expanding this example to include other features of NetworkTransform
in the future.
@NoelStephensUnity Understand, so I think it might be better to add some documents or comments for this component to make it more clear.
Description
AnticipatedNetworkTransform breaks InLocalSpace configuration.
Reproduce Steps
Actual Outcome
InLocalSpace of AnticipatedNetworkTransform is reset to false and transform is synced in world space.
Expected Outcome
InLocalSpace should keep checked in inspector and transform should be synced by local space not the world space.
Screenshots
No need.
Environment
Additional Context
Here is the source code of how AnticipatedNetworkTransform override the OnNetworkSpawn:
The line call
ApplyAuthoritativeState()
will use the initial data ofm_LocalAuthoritativeNetworkState
to override the local configuration likeInLocalSpace
, which is false by default. Please check whether it's reasonable to call ApplyAuthoritativeState in OnNetworkSpawn.Also found those code doesn't check
InLocalSpace
and directly set the world space position:Rotation has the same problem, please review the code of whole class, there are many other places has the same issue.