Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generator does not exactly follow the path
#1
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?
Reply
#2
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
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
Reply
#4
What version of Curvy Splines do you use?
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
Question Generator Canvas workflow issues Sacryn 1 6 02-02-2024, 11:22 PM
Last Post: _Aka_
  Disable Generator Rasterized Objects SAMYTHEBIGJUICY 3 5 09-01-2023, 03:38 PM
Last Post: _Aka_
Wink Train carriage with 2 bogies following a path arcadeperfect 9 26 08-25-2023, 02:56 PM
Last Post: arcadeperfect
  Getting reference to Generator and InputSplinePath Spline velikizlivuk 3 9 08-15-2023, 11:08 PM
Last Post: velikizlivuk

Forum Jump: