Hey everyone. I’m having a problem with the gravityScale on one of my objects being set to zero when it shouldn’t be. My code has gone through many changes and at some point, I may have told it to do this when/where I shouldn’t have.
Basically, I have player characters that throw bombs around. When you’re holding (“cooking”) a bomb, it is set to isKinematic = true, but the gravityScale should still be 1. The problem happens when a player dies while cooking a bomb. When a player dies, the first thing that should happen is it checks to see if the player is cooking a bomb. If so, the Drop() function is called on the bomb which, among other things, sets isKinematic to false, so the bomb drops. This all worked until fairly recently, so I don’t know what the heck I messed with. Suddenly, bombs’ gravityScale is set to zero some time after Drop is called (and it is being called, and the gravity scale is even being explicitly being set to 1 within Drop). I’ve done a Ctrl+F for “gravity” in my PlayerController script and my BombScript, and neither of them ever set the bomb’s gravityScale to 0. It must be happening somewhere else. This, I guess, is why changing public variables directly in other scripts can be problematic.
So the question is this: Is there a debug feature that I’m not aware of, that lets you see where a value of an object is being changed?
Thanks in advanced for any suggestions.