I want to get the actor attached to the component, but I can’t find a way to do so.
I thought I could retrieve them using Get Attached Actors or Get All Child Actors since they were attached to the actor component, but both return empty arrays.Furthermore, there is no function that returns the actor attached to the component.
How to do this?Is this the intended behavior, or is it a bug?If that was the intended behavior, then it’s really terrible.
I’m not entirely sure what you mean, but any actor in your level can be found with ‘Get Actor of Class’. Though, this is a hard/show reference; so, you’d probably opt for an overlap (collision) volume (box, sphere, etc.) or a trace and a BP Interface.
If you mean you want communication between two actors, you could use a BPI and Function Library to pass and contain permanent references, respectively.
If, however, you mean your character and another actor use the same actor component and you wish for them to communicate through it, you can define (store) references to those that use the component as variables and access them through the component itself, see below:
Class is irrelevant.I just want to remove the attached actor.
I’m trying to use the Get function because I don’t want to create any additional variables, but Get Attached Actors doesn’t return anything.This is a scam that deceives people with a false function name.Why can I retrieve an actor attached using Attach To Actor, but not one attached using Attach To Component?They’ll end up being attached to the actor anyway, just at a different hierarchical level.
Sorry, but your wording makes it difficult for me to understand what you’re saying… Are you saying that the issue is still not fixed? If not, read on.
Does that mean you’re trying to retrieve the contents of the array before you actually attach anything? If not, read on.
The ‘Attach Actor to Actor’ node doesn’t work in the same way as the ‘Attach Actor to Component’ node does. You can only have one actor attached to another actor at a time, so there is no need for an array. However, you can have multiple actors attached to the multiple components within another actor, thus the need for an array.
And, according to the UE documentation, the ‘Get Attached Actors’ node is only meant to find actors attached to components within a specified actor, not attached directly to the actor.