- Home /
desc.isValid() fails! Adjusting Configurable joint through script.
I've written a script where my configurable joint angularYLimit parameters lerp from 0 to a set number over time. It compiles without any errors, and also works without a problem. But once every couple of seconds when running the script in runtime I get an error message in the console saying :
D6Joint::loadFromDesc: desc.isValid() fails! UnityEngine.ConfigurableJoint:set_angularYLimit(SoftJointLimit)
I've tried locating the source of this odd behavior but I cannot seem to get my head around it. First I thought it was a problem with using floating point values in the limits field with like dozens of decimals. But even after I truncated the parameters of the variable to round everything to only 2 decimal values (like when adjusting the limits in editor view), I still keep getting the error.
I've seen people get desc.isValid() fail errors when creating new joints or connecting them with itself but this is a joint I've premade and pretuned in the editor view and I am only changing the angularYLimit parameters with a variable that's spitting out .xx values.
Could it be a bug? The console error appears on random intervals when the values are changing. Maybe something with the game engine or the joint not being able to deal with a rapid flow of truncated floating point values in FixedUpdate, and getting calculation errors or... Something?
Ok, I think this certainly is a problem with something not being able to keep up with very fast paced calculations and changing values. The more complicated mathematic calculations I add to the variable the more often the error message appears. And if I use set values it stops appearing completely.
//////////// This is just an example script used for visualizing.
var a : float;
var b : float; ///// say we lerp this value over t
var t : float; ///// used for lerping b and multiplying/dividing stuff.
function FixedUpdate(){
a = 10 * t; ////////// this gives me the error around once every 5-10 seconds.
a = (10 *t) / (b / 100); /////////// this gives me the error like 1000 times a second or more
}
Any thoughts on this? It's most definately something to do with the joint not being able to handle mathematic calculations unless I'm mistaken.