Download

I can't re attach an actor to character after dropping it

guys im having the exact same problem as this guy:
https://answers.unrealengine.com/questions/84870/picked-up-actor-wont-reattach-a-second-time-after.html

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.

Your screenshot is fuzzy. Please upload a clearer screenshot?

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?


guys is there a way i can use something else as root other than the mesh itself but also be able to drop it with physics turned on?

you can used sockets in static meshes

Can u be more specific about that how am i supposed to use a socket as root?

you can use the variable “socket name” as root when doing the attachment.

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.

working with unreal is somehow harder than launching rocket into the space

Why is root a scene and not static mesh?

bcz i want to be able to move the static mesh around inside blueprint so that it looks right when its picked up

inside the blueprint i mean obviously

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…

I guess I wouldn’t use the blueprint item to move the object and would have that system apart

how exactly?

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 :stuck_out_tongue:
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.

1 Like