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
  Curvy not appearing in Unity 2019.2.14f1 bmacdonald1986 5 2,991 11-25-2021, 10:52 AM
Last Post: _Aka_
  Is Curvy splines appropriate to build city streets? atantoine 3 152 11-17-2021, 12:03 PM
Last Post: _Aka_
  Bending splines can break the mesh yanke 3 159 11-14-2021, 10:15 PM
Last Post: _Aka_
Question Generating a path from selected point to the beginning of spline on a closed spline? Zendariel 5 314 10-29-2021, 01:57 PM
Last Post: _Aka_

Forum Jump: