Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Qarterd opened this issue Nov 17, 2023 · 1 comment
Open

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

Qarterd opened this issue Nov 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working question Further information is requested Weaver Bug caused by Weaver

Comments

@Qarterd
Copy link

Qarterd commented Nov 17, 2023

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

@MrGadget1024 MrGadget1024 added the bug Something isn't working label Nov 17, 2023
@miwarnec miwarnec added the Weaver Bug caused by Weaver label Jan 2, 2024
@MrGadget1024
Copy link
Collaborator

@Qarterd This may have been fixed - can you confirm?

@MrGadget1024 MrGadget1024 added the question Further information is requested label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested Weaver Bug caused by Weaver
Projects
None yet
Development

No branches or pull requests

3 participants