Announcement

Collapse
No announcement yet.

Modular OnPickup / OnDrop events. Need help!

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

    Modular OnPickup / OnDrop events. Need help!

    Hello, we're working on our first Unreal project, and we don't really know what the best way of doing things are.

    We have a system that lets you pickup and drop a item.
    Currently there is one blueprint that handle all of the additional functionality. (Such as audio, notifications, etc. on drop and pickup)
    This is a lot of redundant information and fields that does not get used for most of the items. And we want to split it up!

    We had the idea of trying to use ActorComponents.
    Where you would have a array list for events that will trigger OnPickup and OnDrop.
    And you could for example then with ease drag in a NotificationComponent to OnDrop.
    Simple and easy to use!

    How ever, we don't seem to be able to assign ActorComponents to those fields. Weather they are interfaces or base class references.
    Is this not supposed to be possible? What other way could we achieve the same modular setup?
    Will appriciate any help.

    #2
    Array variables dont seem to be able to hold references to components or child blueprints.
    This would make it for a very easy setup in term of execution order, but for now, I ended up solving it a different way.

    I get all components of a base type, cast them to a array of interfaces. Then use the priority field to order them in that list.
    After that I can invoke all the component events in sequence.

    Just wanted to post my solution in case someone stumbles upon this.

    Comment

    Working...
    X