Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting a location above the spline
#1
I might be bad at explaining what exactly I'm looking to do but,

I'm looking for a way to get a position above(as in Y axis) a spline that has been drawn on XZ axis.


Easiest way to describe it might be to have the ray stop as it reaches the XZ coordinates along the spline and wish to get the world position straight above the spline at the cross-section.

   

Currently I'm using ScreenPointToRay to get the position when clicking, but I'm not sure on what would be the best method for what I'm looking to do.
 
I have thought of just looking through the clicked ray that is being cast and using the GetNearestPoint to get the other comparable point, then look for position when the angle from the spline point to the ray is 0, but this method might have various issues if I'm using too curvy splines and the nearest point isn't "below" the clicked point.


The fact I'm looking it to be above is somewhat irrelevant, as I just want the coordinates relative to the click, but due to colliders I believe there will not be a case where the ray from mouse click would hit the location below the spline before hitting anything else.
Reply


Messages In This Thread
Getting a location above the spline - by EeSe01 - 07-11-2023, 08:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to get length starting from one spline to connected nth spline Dragon-3623 1 1 56 minutes ago
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: