Announcement

Collapse
No announcement yet.

passing variables to/from child/parent actor?

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

    passing variables to/from child/parent actor?

    Hi, I'm making a door that consists of a door blueprint and a knob blueprint. the knob is also a child actor inside the door blueprint.

    interacting with the knob unlocks the door, but I can also interact with the door directly, if it's unlocked.

    so I need to pass the value of the IsDoorOpen boolean between the handle and the door. currently I have an interface message/event to pass it, however it seems overkill. is there a way to do the same through a custom event or something? I tried custom event but it says the target isn't compatible.
    behance.net/fael097

    #2
    The Door can talk to the Knob:

    Click image for larger version  Name:	doorknob.PNG Views:	1 Size:	85.9 KB ID:	1624349

    And the Knob can talk back:

    Click image for larger version  Name:	knobdoor.PNG Views:	1 Size:	103.7 KB ID:	1624350



    You can also use a direct reference instead:

    Click image for larger version  Name:	doorref.PNG Views:	1 Size:	94.7 KB ID:	1624351

    So you could call a custom event here:

    Click image for larger version  Name:	knob.PNG Views:	1 Size:	95.5 KB ID:	1624352



    Or an event dispatcher:

    Click image for larger version  Name:	dispatchknob.PNG Views:	1 Size:	108.0 KB ID:	1624353

    Click image for larger version  Name:	doorgetsit.PNG Views:	1 Size:	138.5 KB ID:	1624354
    Last edited by Everynone; 05-26-2019, 06:04 PM.

    Comment


      #3
      wow, many ways to do it! and I always forget about casting
      that's very helpful, thank you!
      behance.net/fael097

      Comment


        #4
        Originally posted by fael097 View Post
        wow, many ways to do it! and I always forget about casting
        that's very helpful, thank you!
        Yeah, there's also Interfaces but you knew that already

        Comment

        Working...
        X