I understand that I can get the most low value of x of an object’s collider using ().bounds.min.x, but on that point where the bound x value is the lowest, can I get its y value as well?
Any help?
Thanks
I understand that I can get the most low value of x of an object’s collider using ().bounds.min.x, but on that point where the bound x value is the lowest, can I get its y value as well?
Any help?
Thanks
Lowest left point for y =collider.bounds.center.y - collider.bounds.extend.y
thanks @Yeezyy and @Dragate for the replies, looks like I found a solution for getting the full coordinate ![]()
I used the mathematical equation for circles, where r^2 = x^2 + y^2, where I get the radius first using collider size.x and y, then reapply into the equation again, by assigning x = collider.bounds.min.x, and r = radius found, and finally I can get the y value where the point is having min x on collider.
Yes it is a box collider, to get the vertices of the rotated boxcollider, then it will need the equation of a circle. Thanks :)
– CheongBrowsed through your code snipped. Saw nothing wrong (except the Transform tr; can be local in the OnIncomingData callback). It seems you do not validate the data at all, so if your data does not have delimiter character | or second entry is not numeric value, the script will not function correctly. So first you should check the data is correct for the second 'player spawn' message (you can log it for instance)
– pmerilainenCan you add code here, expecting people to download files to help is asking too much! and will turn people like myself away.
– akaBase
SInce Bounds represents a box, at runtime you could instantiate (at bounds.min.x) a quad rotated and scaled so it fits the left face of the AABB. With OnCollisionEnter(Collision collision), you can get the contact points. Iterate through them and keep the lowest y. You don't need the quad anymore, so you can destroy it. For OnCollisionEnter to work, you must have rigidbody added. Other more straighforward way is to loop though the vertex positions of your mesh (hopefully it isn't too large). For those vertices that are very close to bounds.min.x, compare their y to keep the lowest.
– DragateNo worries, anytime
– Ak0rn