Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Snap drag to spline?
#1
I am starting to build a 2d maze game, and I want to limit player movement along a set path

I'm thinking to simply use Curvy to set a spline across the entire maze (including to deadends), and then wherever the player drags- use GetNearestPointTF() with the touch/mouse position to snap the object to the result on that hidden spline

Does that make sense? Not sure if I get what GetNearestPointTF() is for (i.e. I'm assuming it can take any point on the screen- but maybe it's actually expecting another point on the spline or something?) 

Either way I think I'll purchase Curvy since I need it for other stuff too (3d camera paths)- but would really appreciate advice on if this is a good approach before I dive in. My math isn't so great and I'm sure you guys have done tons of work to make this sort of stuff high-performance and reliable. 

Thanks!!

Oh I should add- it's a... erm... curvy maze, not straight lines Wink
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 7 1,249 07-13-2025, 07:11 PM
Last Post: _Aka_
  Is there a way to get the position of each ControlPoint in spline by API? Chanon 1 249 06-07-2025, 09:44 AM
Last Post: _Aka_
  Filling a closed spline dynamically rickgplus 1 458 04-16-2025, 08:56 AM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 420 02-03-2025, 09:34 AM
Last Post: _Aka_

Forum Jump: