1. Hello,
    I'm trying to create a bear at the player's location but my code isn't working.
    Code:
    string prefab = "assets/bundled/prefabs/autospawn/animals/bear.prefab";
    GameManager.server.CreatePrefab(prefab, new Vector3(), new Quaternion(), false);
    I tried CreatePrefab and CreateEntity but nothing work.
    I don't have any errors in the console.

    Thank you in advance :)
     
  2. you have created the prefab, but not spawned it.

    You have to CreateEntity first, get the BaseEntity then Spawn.

    string prefab = "assets/bundled/prefabs/autospawn/animals/bear.prefab";
    var createdPrefab = GameManager.server.CreateEntity(prefab, new Vector3(), new Quaternion(), false);
    BaseEntity entity = createdPrefab?.GetComponent<BaseEntity>();
    entity?.Spawn(true);
     
  3. Thank you :), it worked but insted of 'new Vector3()' it worked with 'player.transform.position'
     
  4. CreateEntity returns a BaseEntity, so you actually don't need to use the GetComponent,
    Code:
    string prefab = "assets/bundled/prefabs/autospawn/animals/bear.prefab";
    BaseEntity entity = GameManager.server.CreateEntity(prefab, player.transform.position, new Quaternion(), false);
    entity?.Spawn();
    
     
  5. Oh, thank you it's easier now :)