07-10-2018, 09:23 AM
You are welcome Glad to hear that Curvy is useful to you.
You can use
bool objectNearlyOnSpline = (yourSpline.GetNearestPoint(objectPosition) - objectPosition).magnitude < someSmallDistance;
If performance is an issue, you can use yourSpline.Bounds to test if the object is too far, and use sqrtMagnitude instead of magnitude.
I wrote this post on Android, on top of my head, so the code might have some typos, but the idea is there.
You can use
bool objectNearlyOnSpline = (yourSpline.GetNearestPoint(objectPosition) - objectPosition).magnitude < someSmallDistance;
If performance is an issue, you can use yourSpline.Bounds to test if the object is too far, and use sqrtMagnitude instead of magnitude.
I wrote this post on Android, on top of my head, so the code might have some typos, but the idea is there.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.