Custom foreach iterator

NodeCanvas Forums Support Custom foreach iterator

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10168

    I’ve written custom iterator that goes through a list, but for some reason the variable is not being assigned. Wonder what am I doing wrong. I have check for the chosen variable value against Null – and it is null for some reason. So the _ability var is all good, but _ability.value is null in other nodes. I’m sure that the actual list is fine, as I have a fallback that just randomly picks ability from the same list. It’s this temp variable “_ability” that has its value as null in nodes that are children of my custom foreach node.

    #10171

    Everything seems ok without seeing more, but I am sure the author will respond soon enough with some info, I have seen some odd behaviour around custom iterators when using within cloned instances within prefabs an prefabbed trees but currently it all works.

    #10170
    Gavalakis
    Keymaster

    Hey,

    Have you checked in the blackboard that the List elements within are not null? Could it be that they are null for some reason and as such the iterator do work, but current is null because elements are null?

    By the way if the ONLY difference in your iterator is that it iterates a different list type than game bject, then you can use the attached Iterator Version2 which is possible to iterate any type of list 🙂

    Let me know about you issue in either case.

    Join us on Discord: https://discord.gg/97q2Rjh

    #10169

    Thanks for that!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.