How to iterate on Transform children?

Forums 💬 FlowCanvas ⚙️ Support How to iterate on Transform children?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #21631
    yakdoggames
    Participant

      Hi, new to FlowCanvas.

      What I’m trying to do is to iterate on all the children of a Transform, this is very easily achieved in C# doing:

      But it seems I can’t make it to work on FlowCanvas, tried both Iterate nodes and I only get Null.

      Screenshot attached.

      Thanks.

      #21637
      yakdoggames
      Participant

        Unity 2018.3.2f1
        FlowCanvas latest installed yesterday from assetstore (doesn’t say version number anywhere I can see)

        #21636
        Gavalakis
        Keymaster

          Hello and welcome,

          You should use the normal ForEach node instead of ForEach (T) node like so:
          [attachment file=”ForEachTransform.png”]

          With that said though, there is a bug in the latest version which I’ve just fixed.
          I have attached for you here a unitypackage with the fix for your convenience.

          Please let me know if this works for you with the fix package imported.
          (The version by the way, can be seen on the top right corner of the Graph Editor toolbar)

          Thanks!

          #21635
          yakdoggames
          Participant

            Thanks, will this fix be in the next asset store update?

            #21634
            yakdoggames
            Participant

              There is a compilation problem now:

              AssetsParadoxNotionFlowCanvasModulesFlowGraphsTypeConverter.cs(58,88): error CS0117: 'ReflectionTools' does not contain a definition for 'SingleTempArgsArray'

              When importing the package you sent it only updates 1 file, TypeConverter.cs, maybe you forgot to add the changes in ReflectionTools.cs ?

              #21633
              yakdoggames
              Participant

                My Bad, I didn’t update FlowCanvas to the latest version from the AssetStore.

                But I’m still having troubles after updating and importing this custom package.

                From the for each to Log Value I’m getting a Transform.

                But at the same time if I connect it to the AddForce I’m getting NULL, Even if I use extract Transform I also Get NULL.

                Any Idea?

                Thanks.

                #21632
                yakdoggames
                Participant

                  Solved: Got help on the discord server and it seems I had to explicitly cast to Transform. My mind block was that Log Value was already showing it as Transform and the connection said Null instead of an Error on the AddForce so it never came to my mind that I had to force the Cast.

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