- Home /
Very odd but harmless error? *Not that urgent*
Hello guys! I've received an error that's really odd for me. It says "MissingFieldException : UnityEngine.RigidbodyConstraints.freezePosition", but it stills allows me to play the scene. Also, I've noticed that the error also says "Boo.lang.runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension(IEnumerable candidates)", which is weird because I'm using JavaScript and not Boo at all. Doesn't seem to be doing any significant harm to my game though, I'm just curious. Here's the code that's affecting it:
function Update ()
{
rigidbody.constraints = rigidbody.constraints.freezePosition;
}
In order to compile UnityScript, it is first translated to Boo and then compiled.
Answer by Benproductions1 · Apr 08, 2014 at 10:21 AM
RigidbodyConstraints
is the type
if rigidbody.constraints
. It is quite literally just a "flag" variable, ie. 8 bits of booleans, for rotational and positional constraints.
What you're doing is confusing both instance and static variables, but also using the wrong name.
From the documentation, it's RigidbodyConstraints.FreezePosition
(with a capitol), read the documentation for constraints here and here
It's always best to read the documentation for the thing you have an error message for before co$$anonymous$$g and asking a question. It'll save you time as well!