Announcement

Collapse
No announcement yet.

What is the point of setting object ref variables if you still need a target input ...

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

    What is the point of setting object ref variables if you still need a target input ...

    I am trying to reference to specific components like a root or a child in a pawn class BP in ANOTHER BP like the level BP or another pawn class BP.

    Casting to it doesn't really work because I want to check if a specific component overlaps a trigger.

    To make a long story short I do a set object refence (actor reference category) variables on begin play in the BP where the components are in.

    Then if I "get" those variables in another BP such as a level BP or another pawn class BP then I can call them up BUT they still have a "target" input on the left side of the node.

    I don't get this.

    The whole point of creating these variables is to use them as reference in another BP.

    So what is the point if you still have to hook up the component to it to make it work?

    Also I am just wondering why you run into these obstacles when you are trying to cross communicate between BP classes in C++.

    Is this common in other scripting languages too or is it only in C++ that is because the code is very old?

    Just wondering what the root of this headache is :-)

    Thank you.



    #2
    Click image for larger version

Name:	PU.jpg
Views:	1
Size:	136.1 KB
ID:	1631271

    The crux of my problem is that I need a trigger to differentiate between a root component at a child component of the same pawn class BP. It doesn't seem to be able to see the difference. So if a child component overlaps with a trigger it thinks its the root component too and visa versa.

    So I do after the "on begin overlap" an "is equal to an object" and then a branch and if its true then everything else happens but I can get the BP to see the difference between the individual components.

    Is there an "is equal to component" in stead of "is equal to an object"?

    Last edited by Etienne Andlau; 06-14-2019, 11:06 AM.

    Comment


      #3
      Its an OOP issue?

      Comment


        #4
        O.k. so everything is working flawlessly now. I simply made the component and actor in the world and attached it to the pawn class BP with an actor attach to actor in the level BP. Now I can simply select it in the viewer and create a reference to it in the level BP. So I can do an "equal to" without any issues. Yay.

        Comment


          #5
          Here is a great answer I got from Reddit:

          FYI if you use a collision box instead of a trigger box to generate the overlap event you can use the ‘overlapped component’ pin instead of the overlapped actor pin. This will test against specific actor components.

          So ... why doesn't a trigger box have an "overlapped component" pin?

          Comment


            #6
            Well here it is in all its glory.
            Hopefully not too messy. :-)

            Click image for larger version

Name:	3days.jpg
Views:	1
Size:	337.1 KB
ID:	1631345

            Comment


              #7


              Video of the entire pickup sequence.

              Comment

              Working...
              X