Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find if object is on spline path
#2
You are welcome Smile 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.
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
Find if object is on spline path - by nciofi - 07-09-2018, 12:11 PM
RE: Find if object is on spline path - by _Aka_ - 07-10-2018, 09:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Spline Issue Leading to Unity Freeze Pankaj09 1 201 08-24-2026, 11:28 PM
Last Post: _Aka_
  Connecting Multiple Spline Nodes Issue Ritesh Kadam 1 160 08-22-2026, 11:24 PM
Last Post: _Aka_
  Spline Spots from 2 samples. BitBlit 8 1,079 06-30-2026, 11:49 AM
Last Post: _Aka_
  Best way to duplicate a spline with an offset Kapistijn 8 2,472 04-12-2026, 03:18 PM
Last Post: _Aka_

Forum Jump: