# SetSimulatePhysics on skeletal mesh gives an error and 5 seconds hang, but works

**URL:** <https://forums.unrealengine.com/t/setsimulatephysics-on-skeletal-mesh-gives-an-error-and-5-seconds-hang-but-works/439641>\
**Category:** Blueprint\
**Tags:** not-simulating, unreal-engine, crash, Blueprint, question, CPP\
**Created:** [December 17, 2018, 8:20am UTC](https://forums.unrealengine.com/t/setsimulatephysics-on-skeletal-mesh-gives-an-error-and-5-seconds-hang-but-works/439641 "2018-12-17T08:20:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ATHIEK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ATHIEK](https://forums.unrealengine.com/u/ATHIEK)\
**Post date:** [December 17, 2018, 8:20am UTC](https://forums.unrealengine.com/t/setsimulatephysics-on-skeletal-mesh-gives-an-error-and-5-seconds-hang-but-works/439641/1 "2018-12-17T08:20:19Z")

</div>

So whenever i try `SetSimulatePhysics(true)` it will hangs for like five seconds and give the error :

> LogOutputDevice: Error: Ensure  
> condition failed: !bRegistered ||  
> GetAttachParent()-\>GetAttachChildren().Contains(this)  
> [File:D:\UNREAL  
> ENGINE\UnrealEngine-release\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp]  
> [Line: 2089] LogOutputDevice: Error:  
> Attempt to detach SceneComponent  
> ‘CharacterTPMesh’ owned by  
> ‘BP\_Enemy\_C\_2’ from AttachParent  
> ‘CollisionCylinder’ while not  
> attached.

But physics simulates OK on the mesh, it’s just that nasty error and five second hang.  
also tried using `SetSimulatePhysics(true)` and `WakeAllRigidBodies()`.  
The game is multiplayer and `SetSimulatePhysics` only called on clients and listen server. if i just call it on dedicated server, no error no hangs but it won’t simulate and the mesh just collapse through floor.

Any help i appreciated.

---

<div class="post-metadata">

**Author:** ![ATHIEK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ATHIEK](https://forums.unrealengine.com/u/ATHIEK)\
**Post date:** [December 18, 2018, 11:22am UTC](https://forums.unrealengine.com/t/setsimulatephysics-on-skeletal-mesh-gives-an-error-and-5-seconds-hang-but-works/439641/2 "2018-12-18T11:22:36Z")

</div>

Solved : By calling SetSimulatePhysics(true) in another function by a timer, it no longer freeze or gives an error.

```
GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &AChar::UpdatePhysics, 2.0f);

```

…

```
void AChar::UpdatePhysics() {
	CharacterTPMesh->SetSimulatePhysics(true);
}
```
