Hi @ClockworkOcean, sorry, I’m still learning the “lingo” with all of this stuff, I come from a Unity background, so probably mixing up my words a bit…
What I meant was, when I created my Blueprint for my projectile, I choose the parent class to be of an Actor type. In this specific case I have then added both collision and a static mesh to it. From here, I then created Blueprint Actor Components to add behaviour to this object, in the case of my player for example, I created and added a Health and Attack component.
My aim was to make these as generic as possible so that they could be added to other objects that could then use those behaviours. In the case of both Health and Attack I believe this is the case.
So, the above query was really whether the interface can be implemented as a component level, or only at the main Actor-based Blueprint level. In the case of taking damage via an iDamageable interface, I would want this to talk to my Health component, ideally from “within” that component, as opposed to having the Actor-based Blueprint say “Oh, I’ve been damaged by something, I better tell the Health component”, I just wanted the Health component to say “Ouch!”
If the message has to come through from the Actor-based Blueprint and then get repeated to one of it’s components that means that the Blueprint has to know more about stuff, and I’m not sure whether it should/I want it to. At the moment the Health component, for example, adds behaviour to that object, but the object itself doesn’t interact with it, other than having it as an attached component.
I’m really sorry if I’m not getting this across very well, I don’t think I’m familiar enough with all of the names of things yet to perhaps explain very well.
So, I’ve had a go at implementing this and I’ve run into a little issue…
I have two types of floor tile, one is destructible, one is indestructible. These are represented by individual child blueprint classes of a main parent Blueprint class.
Initially I added the interface implementation to the destructible child blueprint, added a check to the projectile to see if the “other actor” implemented the interface and just added some print nodes to output some text… nothing happened… I wondered whether this might related to the parent/child nature of these Blueprint classes, so I removed the interface implementation from the child and added it to the parent blueprint class. Ran the same test, this time I got output to the screen.
Initially the child blueprints didn’t show that they were inheriting this, I had to close the tab and then re-open it, at which point it was visible in the class settings.
Whilst I appreciate my indestructible child blueprint doesn’t need to do anything with the node, and thus nothing will happen, it will remain indestructible, it seems a bit odd that I’d have a “destructible” interface on the parent which may go on to spawn others which are not… I think I’d prefer to have just the child blueprint that is going to be destructible have this implementation - but the collision detected on the projectile seems to be basis the “other actor” on the parent class.
Surely I don’t need to then iterate through the parent classes children and look to see if any of them have the interface?
Getting closer but still I’m still missing something