Posts: 29
Threads: 14
Joined: May 2020
Hi again,
I'm trying to add an object (let's say a cube) to a spline at the position where the spline was clicked. I'm using raycast and can get the spline clicked hit.point no issue, but how do I then convert that to an actual spline position so I can then add and move the cube to the correct location on the spline?
Many thanks (once again) for your valuable time
John
Posts: 2,110
Threads: 92
Joined: Jun 2017
Hi,
I don't get something: you said you already get the hit point on the spline. Isn't that what you are asking for? Maybe with a drawing or a screenshot I can understand you better
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 29
Threads: 14
Joined: May 2020
Ah, no sorry I'm after the spline.Position value of that hit point (I am using Position Mode as Absolute).
Posts: 2,110
Threads: 92
Joined: Jun 2017
1- Use spline.GetNearestPointTF to get the corresponding TF.
2- Use spline.TfToDistanceto get the corresponding distance
3- the corresponding splineController.Position is distance/spline.Distance
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 29
Threads: 14
Joined: May 2020
Hello and thank you for your reply.
In your step 3, there is no spline.Distance property, where would I obtain that from please.
thanks
John
Posts: 2,110
Threads: 92
Joined: Jun 2017
Sorry, my bad, I meant spline.Length
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 29
Threads: 14
Joined: May 2020
Posts: 2,110
Threads: 92
Joined: Jun 2017
you are welcome
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.