Turn on physics simulation doesnt work from not to true, but the other way around ?!

Hello, i got a problem with an door actor i made, with physicsconstraints.

The door does its job if the physics is enabled at start. But since i want to make some kind of unlock stuff, i turn off simulate physics at start, and just want to simulate physics if a key is pressed.

As you can see in my screenshot, the setup should be correct, because if i set the simulation to true on start, and turn it off after pressing a key, it works and the door stop simulating physics ( so the cast works ).
The other way around doesnt work for some reason, so can someone tell me what i overlook here ?

I dont touch the physicsconstraints in any way, the only thing i manipulate is the door.

asdasdasdad.png

I think the other way doesn’t work because if the door is not simulating physics, cast fails because ‘object’ is nullptr – how are you detecting this object? It is probably not responding to physics test that is meant to detect door’s presence.

Im detecting it with a "get hit resul under cursor by channel " > break hit result > hit actor, this is connected to the “cast to door_actor” which u can see in the screenshot

Should work as you expect it… Can you leave Simulation on, by default, and disable it via the same node on BeginPlay? Will that let you re-enable it on click?

Ok uhm, i now asked if the object is simulating before i set physics enabled to true, and looks like it only then working.

I thought it automaticly knows if it does, since, well, it worked the other way around :stuck_out_tongue:

asdasdasdad.png

So thx for the reminder there Sir !

*Edit: didnt saw your post until i posted mine, so i didnt test your solution with the begin play event.
But its ok for now, i also noticed that the “use simple as complex” collision complexity on the door mesh also made some problems.

Awesome that it works now!!

Aye, hehe, thx for the response =)