# How do i toggle physics during runtime?

**URL:** <https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400>\
**Category:** World Creation\
**Tags:** newbie, Mixed-Reality, unreal-engine, Physics, question\
**Created:** [December 4, 2020, 11:46am UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400 "2020-12-04T11:46:51Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 11:46am UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/1 "2020-12-04T11:46:51Z")

</div>

Hi, I am completely new to unreal engine and just completed microsofts mixed reality chess app tutorial for ue4.  
What I am trying to do is to enable physics while the player does not interact with an actor an disable physics if the player wants to interact with an actor. The reason for what i am trying to do is that none of the mixed reality interactions work while physics is enabled. I tried the following:

![323876-togglephysics.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/3/633ec52dc3415dedd4a86b71fb4c38c67724da10.png)

If i grab the actor while physics is disabled it gets enabled. but when i try to grab the actor again physics does not get disabled. The event fires correctly, what am i doing wrong?

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 11:53am UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/2 "2020-12-04T11:53:59Z")

</div>

You’r picture does not load correctly, check it again please.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 11:56am UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/3 "2020-12-04T11:56:55Z")

</div>

you are right, sorry. should be fixed now.

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 12:02pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/4 "2020-12-04T12:02:44Z")

</div>

np,

Have you done some basic debug, like print physic status on tick ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 12:11pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/5 "2020-12-04T12:11:27Z")

</div>

I set a breakpoint on set simulated physics, clicked the play button in the the main window and tried to trigger the event. How do i print the physic status?

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 12:26pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/6 "2020-12-04T12:26:38Z")

</div>

With print node, then print the boolean value.

I highly suggest you to follow some unreal course before going further.

---

<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:** [December 4, 2020, 12:26pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/7 "2020-12-04T12:26:57Z")

</div>

> If i grab the actor while physics is  
> disabled it gets enabled.

As seen in the image.

> but when i try to grab the actor again  
> physics does not get disabled. The  
> event fires correctly, what am i doing  
> wrong?

Can you show the script that disables physics?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 12:31pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/8 "2020-12-04T12:31:58Z")

</div>

![323877-tickphysics.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/d/a5d97ecc9a5547a3e541f460bb8859d50f5a0701.png)

I printed the physic status and it behaves how I previously described. It is false before I try to grab. true after i grab. And if i grab again nothng changes, even though the event is fired.

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 12:32pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/9 "2020-12-04T12:32:52Z")

</div>

I think you should turn it off when you don’t grab it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 12:37pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/10 "2020-12-04T12:37:06Z")

</div>

Doesn’t the script shown in the first picture dis- / enable it?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 12:38pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/11 "2020-12-04T12:38:36Z")

</div>

Yes, but my thought was that the event does not matter right now, since every event is firing correctly but the value does not change.

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 12:42pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/12 "2020-12-04T12:42:43Z")

</div>

Can you show where you disable it ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 12:44pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/13 "2020-12-04T12:44:12Z")

</div>

Doesn’t the script shown in the first picture dis- / enable it?

---

<div class="post-metadata">

**Author:** ![Aherys](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aherys/32/1194650_2.png) [@Aherys](https://forums.unrealengine.com/u/Aherys)\
**Post date:** [December 4, 2020, 12:49pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/14 "2020-12-04T12:49:20Z")

</div>

No, he just enable it, and only when you start grabbing.

As i say, you need to follow basic courses for blueprint to understand them, cause you obviously miss some fondamentale concept.

---

<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:** [December 4, 2020, 12:57pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/15 "2020-12-04T12:57:43Z")

</div>

> Doesn’t the script shown in the first  
> picture dis- / enable it?

No, it just keeps enabling it. The tickbox controls it. If you want to toggle, consider one of those:

 ![323900-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/4/d9490f0bf8eafeba53741879f2382aef85ba811a.jpeg)

---

<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:** [December 4, 2020, 1:10pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/16 "2020-12-04T13:10:49Z")

</div>

And sometimes it just helps to visualise what is going on, especially when things get complicated:

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/3/6b34239f5a8c1151752c5d322c41461c49128579.gif)](https://gyazo.com/1de00934e9d31911ae48447590af7532)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4d95e8ca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4d95e8ca](https://forums.unrealengine.com/u/anonymous_user_4d95e8ca)\
**Post date:** [December 4, 2020, 1:23pm UTC](https://forums.unrealengine.com/t/how-do-i-toggle-physics-during-runtime/475400/17 "2020-12-04T13:23:18Z")

</div>

Thank you very much. Both solutions work perfectly. And I will definetly look into some courses for blueprints to deepen my understanding like Aherys\_ mentioned.
