Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

GetEntities Does not Exist?

Discussion in 'Scripting' started by FGPArthurVII, Jul 14, 2020.

  1. FGPArthurVII

    FGPArthurVII

    Joined:
    Jan 5, 2015
    Posts:
    106
    I've been studiying the ECS & Job System, I've been following Brackey's tutorial. So I've been slapped in the face by this Error

    "Assets\Scripts\Player.cs(21,27): error CS0103: The name 'GetEntities' does not exist in the current context"

    Here's the code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Unity.Entities;
    5.  
    6. public class Player : MonoBehaviour
    7. {
    8.     [SerializeField]
    9.     private float speed;
    10. }
    11.  
    12. public class WalkingSystem: ComponentSystem
    13. {
    14.     struct Components
    15.     {
    16.         public Player player;
    17.         public Transform Transform;
    18.     }
    19.     protected override void OnUpdate()
    20.     {
    21.         foreach (var e in GetEntities<Components>())
    22.         {
    23.            Debug.Log("Hello World");
    24.         }
    25.     }
    26. }
    27.  
    Also, The Entity Debugger is completelly empty, at all, It only says "No Worlds Selected" How can I setup this World thing?:


    Thanks;
    Arthur
     
    Last edited: Jul 14, 2020
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,069
    FGPArthurVII likes this.
  3. FGPArthurVII

    FGPArthurVII

    Joined:
    Jan 5, 2015
    Posts:
    106