Forum rules - please read before posting.

Better way to remove scene object

Hello,

we followed the 2D game tutorial to remove an object from a scene by disabling its hotspot and setting its visibility to invisible. But now we noticed an alternate one-step method, using Object-Add or remove and adding the Remember transform component to the object.

What's the best way to do this and why? The second seems more straightforward, but the first one is the "official" from the tutorial.

Thanks!

Comments

  • Personally I just consider removing objects from your scene at runtime to not be good practice, unless you never want them in the scene again (e.g. a weapon projectile or something).

    When loading a RememberTransform component, there is a memory intake when searching for the object to re-spawn too - though this is generally only something to consider on mobile platforms.

    Both methods work, however - so it's really up to you and the circumstances of your own game.  There are more methods besides: you could also parent the Hotspot / graphic together, and then use a single Object: Teleport Action to hide them from view.
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.