How do i toggle physics during runtime?

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

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?

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?

With print node, then print the boolean value.

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

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

you are right, sorry. should be fixed now.

np,

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

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?

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

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.

323877-tickphysics.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.

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

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.

Can you show where you disable it ?

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

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:

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

Image from Gyazo

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.