- Home /
Simple example bound box or get the top position gameobject
i'm a bit confused with bound can someone help me out. my goal is to get the peak position or top of the GameObject coordinates, no matter what its rotation and get it to be use as a position of another GameObject.
currently i'm using a Raycast like so
if(raycastIsHit){ //move the transform upwards else stop }
Answer by paulaceccon · Feb 06, 2013 at 09:56 PM
I don't know if I properly understood you question, but I guess you could use bounds.extents. Take a look at these links:
http://docs.unity3d.com/Documentation/ScriptReference/Bounds.html http://answers.unity3d.com/questions/29797/how-to-get-8-vertices-from-bounds-properties.html
thanks for answering, i think i should put illustration next time in my understanding a bounding box is like a representation of an elliptical shape or the radius from the center to the point. the points position is affected by the rotation of the shape but not the rotation of the point, if it is a perfect sphere positions of the bounding box will remain constant in all direction... i hope im right..."the bounding box is like saying want kind of box will fit everything within it without rotating the bounding box" another link: http://answers.unity3d.com/questions/8688/local-bounds-or-not-aabb-bounds.html
Your answer
Follow this Question
Related Questions
Physics.SphereCast please help understand 0 Answers
How to detect which side is the raycast hitting? 2 Answers
Find closest edge of mesh renderer from raycasthit 1 Answer
My Raycast acts like it's hitting something when it isn't 0 Answers
Creating custom character controller collision checking 0 Answers