Someone ever had a issue with Attach Actor to Actor / Attach Acto to Component?
I want to attach my cube to another object when collide but the cube have to maintain its location and rotation respect the parent.
In this example I have the cube when attached to a component snap to a position despite I use Keep World for child position.
Attached the blueprint and the video, in the blueprint in this case I’m using socket but I try also without it but the situation doesn’t change too much, child doesn’t follow the rule
I’ve seen this issue before with attaching actors in Unreal Engine. When you attach your cube to another object, make sure you’re setting the AttachToActor or AttachToComponent function with the Keep World transform rule correctly. Here’s a quick checklist to ensure everything is set up properly:
Check the Attach Function:
Use AttachToActor or AttachToComponent with EAttachmentRule::KeepWorld for location, rotation, and scale.
Blueprint Setup:
Ensure you’re setting the transform rules correctly in your Blueprint node.
Initial Position and Rotation:
Before attaching, double-check that the cube’s initial position and rotation are as intended.
Socket Usage:
If using a socket, make sure the socket is correctly positioned on the parent actor.
Debugging:
Print out the cube’s transform before and after attachment to see if there’s an unexpected change.
If it sill doesn’t work, please let me know. I am not at home right now, so haven’t checked the attached video yet.
I checked and test every rule many times, in my case I think I need the KeepWorld but I notice that testing every rule nothing change, always the same behaviour!
The object is correctly linked to the socket because when I play the animation the cube is moving correctly.
I printed out both relative and world transform before and after the attaching function, I notiche the World Transform before and after are the same but the cube moved to another position.