# Is it possible to have physics simulated objects behave kinematic to objects grabbed by physics handle?

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157>\
**Category:** Blueprint\
**Tags:** physics-handle, physics-constraint, unreal-engine, Physics, Blueprint, question\
**Created:** [November 21, 2023, 1:59pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157 "2023-11-21T13:59:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 1:59pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/1 "2023-11-21T13:59:37Z")

</div>

In my project, I have cubes that a player can grab using a physics handle. My requirement is that I want the grabbed object to not affect other physics objects or other cubes (objects with simulate physics enabled). I want this because, let’s say the player has stacked 2 cubes and now he has grabbed another one, I don’t want the grabbed cube to affect the already stacked cubes so that player can stack the 3rd one as well without disturbing others.

* * *

I will now describe what all I have already tried.

**Approach 1**  
Adjust mass of the grabbed object so that it does not affect others. This does not work. Looks like physics handle ignores the mass of the held object. Check out [this video](https://www.reddit.com/r/unrealengine/comments/pdpmvk/how_can_i_make_held_objects_use_mass_using/) by someone else facing the same issue.

**Approach 2**  
Play around with simulate physics settings for objects based on whether they are grabbed or not grabbed.

1. **Disable physics for the grabbed object:** Physics handle isn’t able to move the grabbed object.
2. **Disable physics for non grabbed objects:** If I try to disable physics simulation for all cubes by default and enable it only for the grabbed one, then as soon as I let go of it, I disable physics simulation and it gets stuck in the air.
3. **Same as 2. but also add checks for velocity and ground before disabling physics for grabbed object:** This works fine in isolation, but if I grab another object before the old grabbed object has settled down, I can still yeet the older grabbed object by pushing it with the new grabbed object.
4. **Disable physics only for the non grabbed objects that are in contact with the grabbed object:** Again, works in isolation but this makes it possible to just hit a falling object in mid air and disable its physics, essentially holding it in-air.

**Approach 3**  
Use physics constraint instead of physics handle. This causes a lot of erratic physics behaviour for me. If I hold a cube and go near another cube, they start doing some going in circles around each other like som planets of equal mass. The grabbed object sometimes vibrates in air even when it is not around any other physics object.

* * *

Not sure what I can do to fix this issue. I found a [similar question](https://forums.unrealengine.com/t/is-it-possible-to-prevent-physics-objects-grabbed-by-the-player-to-stop-being-able-to-push-other-physics-objects/433984) on forum but no solution there. Please suggest how I can tweak the physics handle itself to achieve the result I want, I would prefer using that because I already have it in a stable state.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2023, 2:06pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/2 "2023-11-21T14:06:17Z")

</div>

> [@LostInCode404](#):
>
> I don’t want the grabbed cube to affect the already stacked cubes so that player can stack the 3rd one as well without disturbing others.

Change the grabbed object’s collision type to the one the other physically simulating objects ignore - for as long as it’s being held. Essentially, rather than manipulating **how** the held object interacts with the environment, alter **what** it can interact with.

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 2:10pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/3 "2023-11-21T14:10:59Z")

</div>

@Everynone, in that case my grabbed object will go through the other non-grabbed objects, right? I did try something like that, setting some collision setting to ignore but then the grabbed object was going through (overlapping) others. I want it to behave with other cubes like how it behaves with walls in the environment (the deault level with get with First Person template), i.e. get blocked.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2023, 2:19pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/4 "2023-11-21T14:19:34Z")

</div>

> I want the grabbed object to not affect other physics objects or other cubes (objects with simulate physics enabled)

- both cubes have the same settings - they ignore this new object channel. But since their `Object Type` is currently set to `Physics Body`, they can interact with one another and everything else in the world:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/c/8dc0fb6689bea7caa072ccddce12fc7917c0cacf.jpeg)

- as soon as I grab the top one I will change its object type to:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/4/0140046bbdc0087ed57f678cfa9cb90aaf2e7f0a.png)

It can now interact with everything apart from the meshes that ignore it.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/c/90cefa2ea5a427e597c1de6cd8bd0556e342302e.png)

Give it a go, see if it behaves the way you need. More info just in case:

> **[Collision Filtering in Unreal Engine 4](https://www.unrealengine.com/en-US/blog/collision-filtering)**
>
> Choosing what collides is obviously very important, but it can be tricky, and it’s a problem that we have spent quite a while discussing while developing UE4. The system we have can seem a little complex at first, but it is very powerful and...

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 3:06pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/5 "2023-11-21T15:06:22Z")

</div>

@Everynone, Thanks for the detailed answer.

I tried the setup you mentioned, but the problem is that the objects are going through each other, like seen in your second video.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/2/f/b2f1342ceadaa13212e16fed32a555c94f838e93.jpeg)

I do not want them to overlap, I just want the grabbed object to not exert any force or affect other objects in any way.

For example, see this video. I want the grabbed cube to behave with other cubes like it does with the environment. The other objects should simulate physics, but not receive force from grabbed object. Like when I grabbed the bottom one from the 2 stacked cubes, the top one should fall down as usual because it is simulating physics, I just don’t want it to react to being hit by the grabbed one.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2023, 3:08pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/6 "2023-11-21T15:08:16Z")

</div>

> [@LostInCode404](#):
>
> I do not want them to overlap, I just want the grabbed object to not exert any force or affect other objects in any way.

Got ya, a misunderstanding, my bad. You may then need to disable physics simulation on **everything else** for the duration of the hold.

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 3:11pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/7 "2023-11-21T15:11:17Z")

</div>

@Everynone, the problem with that approach is that when 2 cubes are stacked vertically and I grab the bottom one, the top one will not fall down.

That’s why I was hoping if there was a way to stop exerting force by grabbed object. The mass is not doing anything for objects grabbed by physics handle.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2023, 3:22pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/8 "2023-11-21T15:22:17Z")

</div>

> [@LostInCode404](#):
>
> Approach 4

Did you try playing with:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/c/08c921281bd3ea59f9785b342c6b686fc41d9729.png)

Not sure how that’d mesh with physics handle, though. See if you can disable it while you hold.

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 3:27pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/9 "2023-11-21T15:27:07Z")

</div>

> [@Everynone](#):
>
> Did you try playing with:

@Everynone, I already had it disabled because I did not want my character to affect those cubes as well. Sadly, this setting is part of the character movement, so it only affects the player character, not what it is holding with physics handle.

I also tried tweaking the interpolation speed of the handle, but it only slows down the interpolation of the grabbed object, which reduces the force but doesn’t remove it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2023, 3:42pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/10 "2023-11-21T15:42:16Z")

</div>

Not sure if there’s a native way of handling this. The only thing that comes to mind at this point is to `sweep` a collider that is slightly larger than the held item and stop updating control rotation as soon as the sweep hits another physically simulating object. Could work but seems _janky_ at best:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/0/3e02260bf3e8f8205352646cc09be4914f875c34.jpeg)

This is utterly untested psedoscript I’d experiment with if i got really desperate; fresh out of good ideas.

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 9:32pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/11 "2023-11-21T21:32:27Z")

</div>

I have solved the issue by adding an extra cube, two collision channels and playing around with collision, simulate physics and collision channel settings.

## Collision Channels

I added 2 new collision layers: `InvisibleCollider`, `GrabbedObject`

## Grabbable Cube BP:

**1. ParentCollider**

- This is the main parent of the BP. It is a box collider with collision object type as `InvisibleCollider` and it is set to “Ignore” any `InvisibleCollider`.
- This has simulate physics enabled.

**2. VisualCube**

- This is a cube that is child of the `ParentCollider` component.
- This is the cube that is visible by default for all grabbable cubes.
- This one has simulate physics off so that any grabbed object will not affect it.
- Auto weld is disabled.

**3. GrabCube**

- This is the cube that the character will use for grabbing.
- Collision is set to false by default and visibility is off.
- Collision object type is `GrabbedObject`
- Auto weld is disabled.

## Events

**1. Grab object**

- Enable physics, visiblity an simulate physics for `GrabCube`
- Disable collisions for the `ParentCollider` and `VisualCube`
- Disable visibility of `VisualCube`
- Disable simulate physics for `ParentCollider`

**Grabbed object:** Because of the settings above, the visual cube and its parent collider will not work now in the grabbed cube.

**Other objects:** Even though the `ParentCollider` has physics enabled, it also has ignore for grabbed object, so the grabbed cube will not affect it. The `VisualCube` on the other hand has simulate physics disabled, so that will also not be affected by the grabbed object. Setting auto weld to disabled makes sure that it does not start simulating along with its parent, the `ParentCollider`.

**2. Drop object**

Mostly just the opposite of grab object with one extra step - Copy the location and rotation from `GrabCube` and assign to `VisualCube`.

## Final result:

---

<div class="post-metadata">

**Author:** ![LostInCode404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LostInCode404](https://forums.unrealengine.com/u/LostInCode404)\
**Post date:** [November 21, 2023, 9:35pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/12 "2023-11-21T21:35:26Z")

</div>

@Everynone, I have finally solved it. Feel free to take a look at my solution if you are interested.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 21, 2023, 9:35pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-have-physics-simulated-objects-behave-kinematic-to-objects-grabbed-by-physics-handle/1409157/13 "2023-12-21T21:35:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
