Skip to content

Cannot instantiate prefab. #39

@Herbias

Description

@Herbias

INTERNAL_CALL_Internal_InstantiateSingle can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

Here's my code snippet
socket.On("get_user_online_companion", (data) => { Instantiate(otherUserPrefab); });

I attempt to instantiate it in Update() but when it is instantiate it is automatically destroy and also I cannot use coroutine. I would like to know I can get the source code and try to port it to the latest unity build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions