Hello,
I tried a lot of things to get this work. I’m trying to rescale and resize the bounds of a Box Collider I have in a gameobject in my scene, other components are Text Mesh, Mesh renderer, a simple script and the box collider itself.
I’m calculating the characters of some strings and then I need to resize and rescale my box collider to fill the collider area. But the code above returns me strange errors:
var bounds = Bounds (Vector3.zero, Vector3 (1, 2, 1));
collider.bounds = bounds;
The error:
MissingFieldException: Field ‘UnityEngine.BoxCollider.bounds’ not found.
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.EmitPropertyDispatcher (System.Reflection.PropertyInfo property, SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.EmitDispatcherFor (System.Reflection.MemberInfo info, SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateSetter ()
Boo.Lang.Runtime.RuntimeServices.DoCreatePropSetDispatcher (System.Object target, System.Type type, System.String name, System.Object value)
Boo.Lang.Runtime.RuntimeServices.CreatePropSetDispatcher (System.Object target, System.String name, System.Object value)
Boo.Lang.Runtime.RuntimeServices+c__AnonStorey17.<>m__D ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[ ] cacheKeyTypes, System.Object[ ] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[ ] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
Palavra.Start () (at Assets/Scripts/Palavra.js:117)
I also tried with this:
collider.bounds = Bounds (Vector3(20, posicaoBounds.y, posicaoBounds.z), Vector3(60, tamanhoBounds.y, tamanhoBounds.z));
The posicaoBounds and tamanhoBounds are just some int vars (tried with float too).
This returns me the same error above. I also tried adding “new Bounds”, etc…
Somebody have a clue?
And why its returning me something about the Boo language?