- 1. In your "Barebones Game" scene, place an object anywhere.
- 2. Make and name a new script on this object.
- 3. Declare a variable of the Type EntityReference.
- 4. Add a [SerializeField] tag in the line above this variable to access it in the inspector. It should look like this:
private EntityReference myEntity;
- 5. Take the time now to drag the Entity you want to change into the new field in the inspector.
- 6. To get the GameObject of this Entity you can simply write the following inside of the Start() or Awake() functions:
private GameObject myGameObject = myEntity.GameObject
- 7. From myGameObject you have access to tons of cool properties and variables attached to this Entity. For example, to change the position of the object:
myGameObject.transform.position = new Vector3(0, 0, 0);
- or disable the object in the scene:
for a full list of the cool things you can do, check out: GameObjects .