Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spawn object on Curvy Spline.
#3
Basically, her is how to do it:
  1. Get the direction of the ray representing your click. See Unity's API for that
  2. Get the nearest point on the spline from your ray, more on that at the bottom of this post
  3. Get the TF of that nearest point. If you ask what is TF: https://curvyeditor.com/documentation/sp...tart#units
  4. Create your controller and set its relative position to that TF
About step 2, right now there is no methods in Curvy Spline to get the nearest point from a spline. But you can find those methodsĀ in the link bellow. It is not yet part of the official Curvy Splines release:
https://www.dropbox.com/sh/8k5uwhirs13qq...J0nja?dl=0
Please do not use the files from dropbox to replace your own Curvy Spline files (files of the same name in the Curvy folder), since the drop box files are based on an old Curvy Splines version. Just copy the GetNearestPointTF and GetNearestPointF methods that accepts a ray as a parameter, such as:
public float GetNearestPointTF(Ray ray)
public float GetNearestPointTF(Ray ray, out Vector3 nearest)
etc

Was my answer clear?
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


Messages In This Thread
Spawn object on Curvy Spline. - by ktpttd - 11-19-2019, 08:41 AM
RE: Spawn object on Curvy Spline. - by _Aka_ - 11-19-2019, 12:44 PM
RE: Spawn object on Curvy Spline. - by _Aka_ - 11-20-2019, 01:37 PM
RE: Spawn object on Curvy Spline. - by _Aka_ - 11-20-2019, 01:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,345 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 653 11-13-2025, 11:32 AM
Last Post: _Aka_
  Create Game Object Renaming Options rickgplus 1 934 09-23-2025, 09:33 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,451 07-29-2025, 09:15 PM
Last Post: _Aka_

Forum Jump: