Attaching Blueprint Actor to an Actor - Changes Vector based behavior?

Alright, I’m stumped on this one. First thing worth noting is that I haven’t done any C++ work in this project yet, everything so far has been done in Blueprint. So no easy answer with an oddity in the C++ from my end to fix this one :wink: I’m also using Beta 5.

I have a Blueprint that I created for a custom Actor that allows it to move along a single axis (in this case X) for an indefinite amount of time. Players can fire a projectile at it to change its direction (positive or negative movement along the vector axis) or stop it completely (eventually it will reverse its own direction when it hits something, but that functionality isn’t in yet). This functionality all works as intended until I try to attach the Blueprint Actor to another Moveable Static Mesh inside a level. I’ve been trying to avoid using Matinee for these just because I want my team to be able to drag and drop them into levels without the need for setup every time they want one.

Unfortunately the attachment is a necessity for some of our game mechanics, as we need these Blueprint Actors to update their location when we rotate certain objects in the level, namely the parent its attached to.

So here is what I have for my Blueprint setup:

All of the bools are just flow control to allow the current timeline to finish before the Tick event can fire off the event again (so that I can keep this running endlessly), and to set which direction it travels. The Timeline itself is just a simple 1 second long 0-1 value change for the Lerp to process. Nothing crazy, and again until I do the attachment to an Actor it works exactly as intended. In all of the images below, the printed values on the screen are the starting vector locations of the actor before it processes its Lerp.

Works without Attachment (Blue Cube is what is moving, and my distance per Lerp is an update of 10 on X):

unattached_update_3.png

However, when I attach this Cube to another actor, whether it’s through the editor or through the Level BP (and irregardless of if I keep the Relative Offset, World Location, or SnapTo target for actor attachment in the Level BP), the values get crazy fast and the functionality completely breaks. Again, this should only be moving by 10 on X each Lerp.

Attachment breaks it:

attached_update_2.png

attached_update_3.png

The only other oddity that I noticed with all of this is that when I tell the Level BP to make the Attachment using the Relative Offset, my Cube ends up positioned in the level in a different location than I have it manually positioned (near its attachment parent). In the images below the parent is the little white cube on the left, with the orange cube being the Blueprint Actor (it’s blue when it’s moving).

Actual Position

Relative Offset

Any help on this one is greatly appreciated! If you need any of my files for this uploaded to take a look at just let me know and I’ll get them to you.

Sincerely,

Jeff Verba

We haven’t heard anything on this topic & this community has always been so great about answering questions. I thought I would give it a bump to see if anyone has some insight to add.

Hi Jeff,

We’re working toward responding as soon as possible. Thanks for your patience!

Sean

Thanks Sean! I really appreciate you guys looking into it for me.

I do want to let you know that I have verified that this problem still persists in Beta 6.

Looking forward to see what you find!

Jeff

That’s a really nifty looking robot you got there! good luck with your project! :slight_smile:

Thanks! That’s B.O.B our Bio-analytical Observation Bot or Bucket Of Bolts, he’s very high-tech, as you can see. :slight_smile:

Is the actor that you’re attaching it to scaled by chance? That could be changing the scale and orientation of your moves with the relative attachment node you’re using.

If that’s the case, you may need to adjust the Start and End points by the transform of the object you’re attaching to. If they’re relative to the attaching actor, you should be fine, but if they’re in worldspace, then you’ll need to modify them by the transform of the actor you’re attaching to in order to get them into the proper space for your lerp.

Thanks for the reply Nick!

I ended up finding that I was using the wrong Blueprint Node with these, I was using Set Actor Relative Location (darn false positive results) when I should have been using Set Actor Location. Once I changed those nodes out they started working correctly again when attached.