Finally, the script calls the PickUp event which is declared in the class of the object from the Line Trace. Every object that implements my Interactable interface has the PickUp event.
Everything about the script executes properly except the AttachTo method in the PickUp event. The object just lays on the ground and doesn’t move with my character. I am trying to attach the actor to a Scene Component called WeaponHolder.
Does anyone know how to properly attach an Actor to a Scene Component, so that the Actor moves to the Scene Component and with the Scene Component?
From what I can see, the logic seems to be OK. Is there a reason not to use a socket on a bone? Anyway, if what you want is to attach it to the component, let’s try to solve this.
The only thing I’m not seeing here is how the Weapon Holder scene component is defined. Are you sure it actually contains a reference to a SceneComponent that is linked to your character? I’ve seen similar issue where the problem was simply a variable that was actually not pointing to anything, have you tried putting a breakpoint after your Pick Up event to see if everything was valid?
I am not using a bone because I am going for a minimalist look to my game and am not using a FPS mesh. I check where I am trying to attach it to and it seems like it is in the right location.