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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 0 0 3 hours ago
Last Post: ShiroeYamamoto
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 Yesterday, 07:25 AM
Last Post: amutp
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 0 6 Yesterday, 03:23 AM
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: