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. Dismiss Notice

Text Adventure Second Section Part 6 Not Working

Discussion in 'Community Learning & Teaching' started by BeanJBunny, Jul 1, 2021.

  1. BeanJBunny

    BeanJBunny

    Joined:
    Dec 6, 2020
    Posts:
    1
    I've followed the directions multiple times and cannot get Inventory to add to the asset menu. I have a screen shot right here, you can see the other three working just fine:

    Screenshot (75).png

    I figured I had messed up, so I copied the code off Unity's website and still cannot get Inventory in the asset menu. This is my code, even though it's identical:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. [CreateAssetMenu(menuName="TextAdventure/InputActions/Inventory")]
    6. public class Inventory : InputAction
    7. {
    8.     public override void RespondToInput(GameController controller, string[] separatedInputWords)
    9.     {
    10.         controller.interactableItems.DisplayInventory();
    11.     }
    12. }
    What is going on?
     
  2. GregoryLane

    GregoryLane

    Unity Technologies

    Joined:
    Mar 11, 2020
    Posts:
    45
    Howdy @BeanJBunny! After a quick test, I was unable to replicate this error. Were you able to work out what had been happening? Is it possible there was a console error that was blocking this script from being read properly?