Forum rules - please read before posting.

Inventory item reappears after leaving and returning to scene

Hi everyone. I have an item that my character picks up and puts in his inventory. Whenever I leave the scene and return, the item is back where it was before I picked it up (although it is still in my inventory). What is the best way to fix this? Do I need to use a variable or is there a simpler solution?

Comments

  • In order to save the state of an object in the scene, you need to tell AC what type of data about it you wish to save. This is done by attaching the appropriate "Remember" component to it.

    For example, to save the visiblility of a sprite, you can attach "Remember Visibility". To save an object's position (or "Transform"), you can attach "Remember Transform".

    See the Manual's "Saving scene objects" chapter for full details.

  • Thank you, Chris
  • One related question. Which "Remember" component could I use if I have a hole in the navmesh I am removing after a cutscene (I have a hole in the navmesh surrounding an NPC but once he walks off screen I don't want the hole to remain.) To prevent the hole from reappearing once I leave and return to the scene?
  • The "Remember Nav Mesh 2D" component, which should be attached to the main NavMesh object.

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.