Forum rules - please read before posting.

Items will not show in inventory

Hello!

I came across something that I'm guessing is really simple to figure out, but I can't seem to find a solution.

I have 2 characters to which I can switch between scenes. I want them to gather different items, and to stick with them as I switch. My actions didn't have the "affect specific player" before, I could add the items normally but they disappeared as I switched. Now, I checked "affect specific player" when adding the item, and the item simply will not show up in the inventory.

My version is 1.58.

Thanks in advance :)

Comments

  • edited September 2017
    Can't recreate.  I take it you mean that they don't show up once switching to the relevant character.

    Can multiple instances of the item be carried?  Are you using item categories?

    That option is generally only necessary if you want to affect a player who isn't currently being controlled.  Is this Action still adding the item to the active player, and are other items showing up correctly?
  • Hey Chris.

    When I check "affect specific player", the Items won't show up in the inventory, even if I am the player getting the item, and not switching.

    When I don't check this option, the item will be added normally, however, when I switch players, and switch back, it isn't there anymore.

    The box "can carry multiple?" is not checked.

    I'm not using item categories either. (I'm still noobish, and I don't know what they really are for.)
  • Are you using local player objects (i.e. those in the scene file)?  They don't mix well if multiple player prefabs are listed in the Settings Manager.

    What is the state of the All players share same Inventory? option above the list?

    We'll need to do a bit of debugging to learn what's going on.  Inside RuntimeInventory.cs, there's a function "void Add" (around line 319) that contains:

    if (playerID >= 0 && KickStarter.player.ID != playerID)

    Directly above that, insert the following line:

    Debug.Log ("Want to add item " + _id + " to Player " + playerID + ", Current player is " + KickStarter.player.name + " (ID = " + KickStarter.player.ID);

    What does the Console output when the Action is set to add it to a specific (and current) player?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.