Announcement

Collapse
No announcement yet.

Find in array input?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Find in array input?

    So I've got a jigsaw puzzle game I am making and it's mostly functional now but I ran into a problem with my scripts when publishing to Android. It seems that my script breaks on mobile because the script relies on breaking apart the actor name when checking overlaps and on PC it works fine but apparently in the conversion to mobile it changes the actor names and no longer works.
    Anyway I am trying to go back to sorting out my original solution which is to use an array. When the puzzle is generated all the pieces are put into an array. What I need to do now is check that array for the current piece that is being overlapped when the player drags a piece. I am trying to use the FIND array node but I can't seem to get the hit actor from the hit results to input to the FIND node in the array.

    #2
    I still can't seem to find out how to get these to talk to each other. I have tested and confirmed that the array has the actors in it that I want to test against but I can't find out how to make the hit actor results from the multitrace by channel test compatible with the find in array node.

    Comment


      #3
      you need to a cast to, the actor you are hitting, lets say the charcter, you will make a cast to character attached from the hit actor then attached to the find array.

      Comment


        #4
        "Cast to" whatever actor is compatible in the array items ;o

        Comment


          #5
          Well in this case I don't know what to cast to. This script is in the game mode blueprint and I am looking for my "puzzlepiece" actor BP which there is an array of those created on event begin play by a puzzlespawner BP. So... do I cast to the puzzlespawner BP that generated them? Do I cast to the puzzlepiece BP which is the type of actor I am "finding". Also when I cast to one of those what do I put in the object input? I've done some casting in other scenarios in which the answer was easier but this one is stumping me.

          Comment


            #6
            Actually nevermind I just tried hooking it to the "overlapped actor" and it worked great. Thanks for your help.

            Comment


              #7
              a "cast to" node right?

              Comment


                #8
                Yeah I cast to the class of the overlapped actor and it worked fine. Thanks

                Comment


                  #9
                  If you ever run into this issue elsewhere these videos may help you with the "cast to" and "wildcard" object pin. Video 1 is about casting and 25 will show you how to get references to actors when the easy "overlapped actor" pin isn't what you want or isn't suitable for the particular case.

                  https://www.youtube.com/playlist?lis...1jewB5s78zQHIy

                  Comment

                  Working...
                  X