ICastFist,
@ICastFist@programming.dev avatar

Ok, tell me if I got it right. Your node structure is currently like this:


<span style="color:#323232;">> Map
</span><span style="color:#323232;">>> hexgrid
</span><span style="color:#323232;">>> spawn_objects
</span>

And you want things to happen in this order:

  • Hexgrid instantiates the grid and tiles
  • spawn_objects will run for certain tiles

If I got it right, then this is a situation where signals are not needed. What I would do:

  • On the Hexgrid scene, add spawn_objects as a child node

<span style="color:#323232;">> Hexgrid
</span><span style="color:#323232;">>> spawn_objects
</span>
  • Within the Hexgrid script, when the desired tile needs to spawn something, call the function from the node. Either $spawn_objects.spawn_this_thing() or declaring the node as an @onready var spawner = $spawn_objects (…) spawner.spawn_this_thing()

Since you’ll be calling the spawn code from within the hexgrid, you’ll have full access to both nodes’ variables, parameters and functions. If you needed to get a “spawn_here” variable from the parent while within the child, you could use get_parent().spawn_here

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • [email protected]
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • TheResearchGuardian
  • Ask_kbincafe
  • KbinCafe
  • feritale
  • Socialism
  • oklahoma
  • SuperSentai
  • KamenRider
  • All magazines