Closed Drakenexh closed 7 years ago
Still haven't been able to reason through any potential causes of this conflict. Really isn't anything in the TU code that should muck about with physics or collisions.
Have a couple possible solutions to implement though that could alleviate any 'vessel' related problems -- only have one RP in the scene, ever; constrain it to follow the FI.ActiveVessel, so it should still affect the currently controlled vessel properly, but will ignore any non-controlled vessels (non-controlled vessels will get their reflection-probe data from the same probe as the controlled vessel; meaning their reflections will be noticeably misplaced, but the distance of the uncrontrolled vessel will likely make the visual impact minimal; box projection on the probe itself could further alleviate this distortion).
Can confirm the issue using the craft provided (thanks!). (I didn't get explosions, but stuff definitely flew all over the place from collider issues).
Investigating now, will update once I know more about what is going on.
Because so far is the only incompatible mod reported, couldn't be easy just to ignore anything PF related? Or the mandatory check couldn't tell them apart?
I don't touch colliders at all, so realistically, there shouldn't be anything to ignore.
But this --
[F: 22220]: KzResizableFairingBaseRing collided into SSTUReflectionProbe
is telling me that there is some sort of collider, somewhere, added onto the reflection probe (maybe it is being added by PF itself?).
Huh, apparently Unity code is... a bit dumb. When I create the reflection probe, I also create a 'primitive sphere'. These all come, by default, with a primitive SphereCollider component. So, immediately after I create the sphere, I find and delete this collider.
Problem averted, right? That is what I thought.
But apparently I thought wrong. Unity decides to only delete that collider after a frame has passed; and in that one frame of time, explosions and hilarity ensue.
Changing from GameObject.Destroy()
to GameObject.DestroyImmediate()
, and the problem goes away. What fun it is to work with Unity (sarcasm).
Initial testing results in explosion-free decoupling (well, as explosion-free as it gets in KSP). Doing one more round of testing, and then will clean the code up and call it solved.
Thanks @Drakenexh for your help in tracking this one down.
Sir you are a steely eyed missile man.
You welcome!
Experiencing violent explosions/disassembles when staging PF fairing. Works fine with stock fairings. Attached, craft file to reproduce issue.
PF Test.zip
Console/log output: