guys im having the exact same problem as this guy:
apparently the problem is the root component which in my case is a scene component, and I need to have this scene component bcuz of my setup, there are a lot of items that I wanna be able to pick up so I need to have something else as root to be able to scale up or move my item around to make it look the way I want it.
I’ve also checked the outliner when I attach it to my character, the code is definitely working cuz I see the actor being parented to the character however, it just works if the physics is turned off.
so my question is isn’t there a way to do this while having a root component? and why is this happening in first place if the physics is disabled before picking it up it should’ve work.
I think in your setup, what you’re missing is just moving it back to the original relative transform before attaching it back to the root. If you hit F8 during PIE and move around, you may find it’s actually re-attaching, but not where you thought it would. I recommend in your Take event, after turning off simulate and setting your collision response, you should drag off the mesh and “Set relative transform” then set this back to 0,0,0 at location and rotation and 1, 1, 1 for scale or whatever values you like for the default, and then attach it to the root. Should fix the issue for you.
The reason this happens is when you simulate physics on a mesh, it will detach from the root and then be in a completely different relative transform, so resetting it back should solve things.
I’m starting to see the problem here, but setting the transform of the mesh is not the solution, bcz when I set it back to 0 0 0 the mesh floats in the air cuz that’s where I detached it and the root component just stays there in the air so the problem here is that the root doesn’t fall to the ground with the mesh, does anyone have a solution for this?
there’s no such function that attaches a mesh based on its socket point. the attach component to component only takes one socket name which belongs to the parent actor and not the target.
there’s one way i could do it and that is going back and forth 10000 times between blender and unreal until i get the pivot point right for all the meshes i have, but bruh…
Yeah, what I meant was that you need to reset it to the same value it was in relation to the root before re-attaching back to the root. 0,0,0 was just my assumed location of the mesh in relation to the root, and I figured you’d fill in your desired values.
Maybe we need some more clarity on what you’re trying to accomplish. Are you trying to attach a crowbar (weapon) to the player’s hand? To do this, you wouldn’t use a blueprint and offset the mesh from the root, you would just add a Weapon socket to the hand bone of the skeletal mesh and then offset the socket’s location. I think you might be going about trying to accomplish what you want in the wrong way as is often the case when you’re leanring. I do it all the time
Tell us exactly what you’re wanting to do, and maybe instead of fixing your current code, we can suggest a different method.
i actually figured it out couple of days ago not only I should have reset the transform of the mesh I also needed to re attach it to the root cuz it was being detached after simulating physics.