Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GameObjects that move along the path of Curvy Splines will protrude.
#1
Hi,
I have a question.

I want to move GameObjects along the path of Curvy Splines, but when I bend the path by changing the position of the CP of the path, the objects will be displaced from the generated mesh.
Please see the videos to see how this happens.
(Please view with Google Chrome)
https://dotup.org/uploda/dotup.org2625121.webp
https://dotup.org/uploda/dotup.org2625123.webp

The first image shows the case where the CP position of the path is changed, and the second image shows the case where the CP position of the path is all set to 0.
In the first case, we want to move the object without it protruding from the mesh as in the second case.

The object is programmed to move on the path as time passes.
Every frame calls curvyPath.Interpolate(TF);, and TF increases over time.

In our current implementation, we use the position of each CP in the Input Splines Shape to prevent objects from protruding from the mesh (although they do as a result).
I think I probably need to do some kind of correction for the position obtained by curvyPath.Interpolate(TF);, but I don't know how to do it.
Could you let me know.
Reply
#2
Hi
I believe your issue is not due to the position of the moved object, but it's orientation. If you decide to use the curvyPath, then you can call CGPath.InterpolateUp and CGPath.InterpolateDirection to get the forward and up directions at each point of the path. Similar methods exist too for the CurvySpline class.
I hope this helped
Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Thank you for your quick answer!
It is very helpful as I was having trouble.
I will try the method you taught me as soon as possible.
Reply
#4
You are welcome
If and when you feel like it, please leave a review for the asset, that helps a lot
Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
As for my question, I was able to achieve this by using a similar method in the CurvySpline class.

InterpolateAndGetTangentFast
GetOrientationUpFast

In addition, I was able to accomplish what I wanted using Quaternion.LookRotation.
Thank you for your fast and accurate support!
Curvy Splines is a really great the asset.
Reply
#6
Thanks. Glad to see that you are enjoying using Curvy Splines.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  Can't set CG Path Controller j95677 4 22 10-04-2024, 06:55 PM
Last Post: j95677
  Player move with object mcarman 4 8 07-29-2024, 06:49 PM
Last Post: mcarman
Information New free asset: Converter For Dreamteck Splines _Aka_ 0 0 07-19-2024, 08:27 PM
Last Post: _Aka_

Forum Jump: