Forum rules - please read before posting.

Action list asset does not remove spawned object

edited August 2023 in Technical Q&A

Hi,

I have a hotspot that when clicked on:

  • Passes parameters to a "Close-up of Sprite" asset Acion List and runs this
  • The "Close-up" action spawns an instance of a Sprite Renderer prefab and shows a close-up of this sprite
  • Opens an "Exit close-up" menu and passes on parameters to the "Exit close-up" exit button asset action list

All parameters seem to pass on fine, but in the end when exiting the close-up, the spawned instance of the Sprite renderer prefab is not removed from the scene.

The hotspot itself is also spawned, and can be spawned anywhere in any scene, so I need to add/spawn the Sprite renderer prefab as opposed to teleport it from an off-scene location.

Here are screenshots of action lists and inspectors:

https://imgur.com/a/486LiFU

// Magnus

Comments

  • It may be that the "Object to remove" parameter is being mapped to the original prefab, rather than the instance of it in the scene.

    You can force this distinction, however, by re-assigning this parameter in the Object: Add or remove Action that spawns it in.

    At the bottom of this Action, set the Send to parameter field to a new GameObject parameter named e.g. "Spawned object". Then, use the ActionList: Set parameter Action to pass this to the ExitCloseUp asset's "Object to remove" parameter (replacing the existing one setting it to the original "Object to remove" parameter).

  • Yes, worked great! Thanks !!

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.