How to lock the rotation of an Object that is held ?

Hello everyone,
I just switched from unity to unreal. And I’m new to blueprint.

So, I would like to create a grabbing system, where you could lift different props.

back in unity, I had an empty that was a child of the player and I had a script that was basically mirroring the transform of the picked object to the transform of the empty (that was roughly where hands should be)

Now, in unreal, I would like a similar effect. I don’t want to feel like the object is levitating, but really in the hands of the player.

I’ve come across the Physic Handle method to do so. it kinda works, but the issue that, since the object is physic simulated, when grabbing it, it is extremely wiggly. Like you can see in this video : https://youtu.be/nImA-kIg42g

Here’s my current node setup :


(sorry if it’s a little messy)

what I don’t understand is why this part :


Doesn’t lock the rotation X and Z to zero since I’m basicaly telling the object to set it’s rotation to (0 someting 0) every frame

What I’m trying to archieve is something a bit like in lethal company when you pick up a heavy item and you old it with both hands (I made this game way before LC released but that’s a good example).
( here’s a random video of the game where someone hold a heavy item in case you’re not familiar with the game : https://www.youtube.com/watch?v=QyGLNnn-4nk )

Here’s what I’ve tried so far :

  • disabling gravity when lifted (the object was still moving due to collision and friction)
  • disabling collision (wouldn’t work because the object is physic simulated)
  • setting the rotation of the object to 0 for X and Z

I still want the object to be physic simulated when not in the hands of someone tho.

Thank you for your help,
Have a great day,
Louis

High, Louis,

Why not disable physics when the character picks them up, and then attach them to a specific bone/socket?

When the character places them down again, you can reenable physics.

1 Like

Yes,mr.Leo is right.
You should disable simulating physics while take up the actor,and enable physics again while put it down.
And the empty gameobject on your character hands in Unity is called a socket in unreal.

And you can’t use “set position ”and”set rotation ” on a physics body. That’s kind of teleporting.

1 Like