Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get position on spline relative to world position
#1
Hello

I am trying to Get position on spline or TF that is relative to world position. here in image the spline is 2D and its positioned at (0,0) and i have gizmo point (green one) that its position is (5,8,-4).

I need to get the position or TF on spline for a point that is also have same x as gizmo point (5).

Thanks


Attached Files Thumbnail(s)
   
Reply
#2
Hi
I believe you need to use the CurvySpline.GetNearestPointTF()
Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
Oh man, I feel so stupid. I used CurvySpline.GetNearestPointTF() before, and now I completely forgot about it.

Thanks man this is exactly what I need.
Reply
#4
(05-10-2021, 12:49 PM)Mos Def Wrote: Oh man, I feel so stupid. I used CurvySpline.GetNearestPointTF() before, and now I completely forgot about it.


No worries, I will put on the account of fasting Ramadan Big Grin
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#5
(05-10-2021, 12:59 PM)_Aka_ Wrote: No worries, I will put on the account of fasting Ramadan Big Grin

LoL Big Grin  its because of fasting Ramadan
Reply
#6
Wink
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#7
(05-10-2021, 07:07 AM)_Aka_ Wrote: Hi
I believe you need to use the CurvySpline.GetNearestPointTF()
Have a nice day

Hello, is there a function for the opposite effect? Ability to plug in a TF and get the world position of that point at the the spline? I want to get the world position on the spline that is closest to my player as a Vector
Reply
#8
CurvySpline.GetNearestPointTF() has an oveeride that returns you the position on the spline. Otherise, you can use Interpolate. I recommand you to read the documentation to know about the basic functions:
https://curvyeditor.com/documentation/ex...ed_methods
then if needed
api.curvyeditor.com
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#9
(05-19-2021, 01:18 AM)smackledorf Wrote:
(05-10-2021, 07:07 AM)_Aka_ Wrote: Hi
I believe you need to use the CurvySpline.GetNearestPointTF()
Have a nice day

Hello, is there a function for the opposite effect? Ability to plug in a TF and get the world position of that point at the the spline? I want to get the world position on the spline that is closest to my player as a Vector

Since posting this I figured out the solution, nevermind! For those who stumble here in the future:

Code:
Vector3 P;

float pTf = currentSpline.GetNearestPointTF(transform.position, out P);

Where P is the world position of that TF!
Reply
#10
(05-19-2021, 05:06 AM)smackledorf Wrote: Since posting this I figured out the solution, nevermind! For those who stumble here in the future:


You seem to have missed my answer to that question. Glad that you took the time to share your finding for others, appreciated.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Filling a closed spline dynamically rickgplus 1 119 04-16-2025, 08:56 AM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 217 02-03-2025, 09:34 AM
Last Post: _Aka_
Information Questions regarding spline colliders and collisions with rigidbodies Spyboticer 7 801 01-20-2025, 12:25 PM
Last Post: _Aka_
  Extrude mesh along spline. New and confused user GhostStalker 3 376 01-02-2025, 09:58 AM
Last Post: _Aka_

Forum Jump: