- Home /
Controller.bounds.(min/max) is giving me a value I have trouble with interpreting
Hey again everyone :)
I have a very small question about the test results I received while attempting to do a movement with my character controller.
There is an event that occurs (doesn't really matter for the question) and then a method is called which does a capsule cast (you don't need to understand it for this question either). One of the values I am using is controller.bounds.min.y and controller.bounds.max.y .
Here are the results on a breakpoint:
...min.y = 0.20
...max.y = 1.69
and the extents of the bounds say the center is at 0.7.
So 0.7 - 0.20 = 0.50 --> deltaCenter = .5
and 1.69 - 0.7 = 0.99 --> delteCenter = .99
So the center isn't the center even on the first frame this hits? That's strange, since I only change the controller size on an unrelated event that does not occur here (which would make sense so I checked before asking everyone for their time here).
So penny for your thoughts really. Doesn't seem to change a couple of frames later, think the bounds is just broken? Or am I missing something obvious again?
EDIT 13:13 GMT+1 12/09/2010:
I can verify that the values of the bounds min and max are accurate. When I put some test objects in my scene at all the aforementioned values I can see compared to the character controller that both min and max are the center values of the spheres of the character controller capsule and that the center of the cylinder is actually a little bit offset along the negative y axis (at 0 rotation on X axis). Meaning that the cube on 0.7 shows a little lower than the center of the cylinder. Can someone confirm that bounds is broken or is this a code fluke I am overlooking?
I must admit I am too fussy in my head to understand your situation entirely but I just want to add in that I had problems with bounds (renderer bounds) that were slightly off, never really aligned with the object they were trying to contain. It was almost as if they had different coordinate systems. I don't know, I gave up my bounds code and made a manual approach ins$$anonymous$$d :( Not sure if this helps or breaks you but I wasn't able to figure out the bounds, in that case.
No this helps a lot actually, I am looking for people that had similar problems and that can describe them. If it's a glitch I think the tech $$anonymous$$m should be informed and a wish list item posted to fix it since having inaccurate position data with the low feedback I'm already getting as programmer compared to my usual environment(s) I feel it's problematic enough to do so. But that's just me and my experience is limited. So I figured I'd double check the problem and find some more opinions on the matter. So in short, thank you :)
I was driven insane trying to figure out why I couldn't get my bounds to fit the object I was trying to contain. I feel so much better knowing someone else have the same or a similar problem. I am dying to see if there is any problem with bounds or if I am just a thick programmer who can't grasp anything as mysterious as a box :)
Yeah know that feeling all to well, You don't want to blame the bounds property and risk losing face but you don't want to admit your code is wrong after checking 500 times either, it's a lose-lose!
Your answer
Follow this Question
Related Questions
Inverse the mouse position value 2 Answers
Random value from -1 to 1 2 Answers
change playerpref number by one 1 Answer
using enum value in cs? 1 Answer
Findinga GameObject Transform 1 Answer