Search Issue Tracker
By Design
Votes
0
Found in
5.6.0f3
Issue ID
903614
Regression
No
ClosestPointOnBounds() returns closest point IN bounds
The function "collider.ClosestPointOnBounds()" is misleading since it gives you a point inside bounds not on bounds (on = contact, in = inside).
If the input position is already inside the bounds the output won't be onto the bounds limits but will instead return the input position values.
This should be renamed to ClosestPointInBounds(), or the code for the function should be edited so the function returns closes point ON bounds.
Reproduced on:5.4.3f1 5.5.2p2 5.6.0f3 2017.1.0b1
Comments (3)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
- White lighting artifact when a point light with a small emission range and "Hard Shadows" touches an object while a directional light with "Soft Shadows" and another point light are present
chriscode
Jul 08, 2018 22:18
Agreed
RoutineAyhan
Mar 16, 2018 09:48
I too think that this is a misleading name. Had the same problem a few minutes ago.
JohnHacker
Oct 24, 2017 21:15
I agree with OP. You can know if the point is inside bounds and use the point if that's your desire, but there's not a built-in function that returns the point ON bounds.