Posts: 2
Threads: 1
Joined: Apr 2023
i don't use build in controllers to move along the path, I need special moving and data processing and curvy controller doesn't meet my requirements. I took part of the code from the controllers and everything was ok until I made hills. My object now constantly goes into road mesh or fly over it. I do not want to have extra calculations to move like Volume Controller, but I want generator exactly follow the path! Is there a way to solve my problem?
Posts: 2,110
Threads: 92
Joined: Jun 2017
Hi
Sorry but I am not sure to understand what the request is. From my understanding, the solution would be to use a Path Controller, which input path should be a path projected on the terrain using the Conform Path module. A full example can be see in example scene 24_CGConformPath.unity.
Did this answer your question? If no, can you describe more or send me a reproduction case?
Thanks and 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.
Posts: 2
Threads: 1
Joined: Apr 2023
I have a lot of objects moving along the path, and rather non-standard calculations, I do not want to use built-in controllers or complex calculations like volume controllers. For moving I refer directly to the class CurvySpline like this:
float tf = 0;
int dir = 1;
Vector3 targetPos = mySpline.MoveByLengthFast(ref tf, ref dir, distance, CurvyClamping.Loop);
Vector3 ver = mySpline.GetOrientationUpFast(tf);
targetPos += ver * .5f;
Quaternion rot = mySpline.GetOrientationFast(tf);
myHero.transform.rotation = rot;
myHero.transform.position = targetPos+myHero.transform.right*shift;
when the path changes its height, road generator does not exactly follow this path, so my objects sometimes fly over it, and sometime goes inside the mesh. this problem does not exist on a straight line, only on hills, but even on small ones, so I think that the generator smoothes somewhere and does not exactly repeat the path
Posts: 2,110
Threads: 92
Joined: Jun 2017
What version of Curvy Splines do you use?
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.