Skip to content

Setting a SyncVar in a Generic results in an error #3654

@Qarterd

Description

@Qarterd
public class Base<T> : NetworkBehaviour
{
    [SyncVar] public bool syncvar;
    public Base() { syncvar = true; }
}

results in the following error:

Modifying a [SyncVar] from another assembly is not supported. -- both assemblies printed in the error are the same assembly

despite the error, derived classes do seem to be working for my use case, the syncvar is set once in Start() on the host and connecting clients somehow see it, I guess because the value is still being serialized even though the setter isn't working

Metadata

Metadata

Assignees

Labels

WeaverBug caused by WeaverbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions