Dear Friends at Epic,
I am posting this here because it is a scary issue indicating some underlying issues that did not exist in 4.0.2.
This is an issue for 4.1 that did not exist in 4.0.2
**Reproducing the Crash**
1. Spawn Static Mesh Actor into world, from SMA extending class
2. Set this spawned mesh to simulate physics,
3. Then on key press or some other event, do the following in same tick / same function:
4. end physics
5. Set Actor Transform
**It causes a crash to desktop!**
**This exact same code worked just fine in 4.0.2!**
In my case I am doing 4 and 5 from within the SMA-extending class itself
More Info
Ending Physics or SetActorTransform, but not both (in same tick),
does not cause a crash.
Which just makes it even more disconcerting to me
**Code**
```
//End Physics
StaticMeshComponent->SetSimulatePhysics(false);
//Restore Editor Pos
SetActorTransform(Vibes.RedVibes.VictoryTransform);
```
**
Crash Abbreviated**
ServerAcknowledgePossession_Implementation VictoryWarriorSpiritBP_C_0
[2014.04.26-15.27.33:142] 97]LogThreadingWindows:Error: Runnable thread TaskGraphThread 0 crashed.
[2014.04.26-15.27.33:142] 97]LogWindows: === Critical error: ===
[2014.04.26-15.27.33:142] 97]LogWindows: Fatal error!
Crash in runnable thread TaskGraphThread 0
[2014.04.26-15.27.33:142] 97]LogExit: Executing StaticShutdownAfterError
[2014.04.26-15.27.33:142] 97]LogWindows:Error: Error reentered: Runnable thread TaskGraphThread 0 crashed.
[2014.04.26-15.27.33:142] 97]LogWindows:Error: HandleError re-entered.
[2014.04.26-15.27.33:142] 97]LogWindows: FPlatformMisc::RequestExit(1)
[2014.04.26-15.27.33:142] 97]Log file closed, 04/26/14 11:27:33
**Workaround Solution = 0.01 Second Timer**
What I used to do in same function / tick I now have to separate out by a 0.01 second timer.
1. Disable physics and start timer
```
StaticMeshComponent->SetSimulatePhysics(false);
GetWorldTimerManager().SetTimer(this,
&AVictoryWall::PHYSICSCRASH_DoTransformUpdateNow, **0.01**, false);
```
2. Timer then calls SetActorTransform()
```
void AVictoryWall::PHYSICSCRASH_DoTransformUpdateNow()
{
SetActorTransform(Vibes.RedVibes.VictoryTransform);
}
```
The Big Picture
I have an in-game level editor, when game starts, physics is turned on and the SMA goes wherever it goes,
when player exits in-game mode, the physics is ended on the SMA and SetActorTransform is called to restore it to its Editor Position
This scenario being done over and over is how I encountered this bug.
The crash happens on the very first attempt however, it does not take multiple attempts.
AnswerHub version of this post, with full Log
https://answers.unrealengine.com/questions/35348/ending-physics-and-setting-transform-in-same-tick.html
Thanks!
Rama
PS:I am double posting on answerhub and here because this is a scary issue to me, it needs to be addressed ASAP or else it will cause further destabilization and bugs people may not figure out for awhile