Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extrusion does not match Controller position
#1
Hi

I am having a bit of trouble.

My aim is to generate a spline that I willl use as the "map" like you would see in a lot of mobile games. It has nodes along it that are the levels, and as you complete nodes, the line extrudes out to the next node so you can see where you are up to.

In order to get this to work, what I am trying is:
Place the controllers along the spline using relative position. (this works fine)

At runtime, I get the reletive position of the controller, and then I set the extrude "to" value at that same value.

However there seems to be a bit of inaccuracy. It gets close however when the value is < 0.5 then the extrusion seems to overshoot or go past the controller. If the value of the "to" is > 0.5 then the extrusion seems to not reach the controller.

Is there some odd calculation that goes on? is it somehow calculating the extrusion reletive to the control points the current extrusion Is between while the controllers are relative to the distance of the entire curve?
Reply
#2
Hi,
There is indeed a difference. Controllers use the TF, and extrusion uses relative distance (distance / spline's length).
A solution, besides doing the conversion yourself, is to use a Path Controller instead of a Spline Controller, because it uses relative distances.
Did this help?
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
(05-26-2020, 11:30 AM)_Aka_ Wrote: Hi,
There is indeed a difference. Controllers use the TF, and extrusion uses relative distance (distance / spline's length).
A solution, besides doing the conversion yourself, is to use a Path Controller instead of a Spline Controller, because it uses relative distances.
Did this help?

That seems to have done the trick!

Thanks so much for the quick response. Still learning just how this thing works Smile
Reply
#4
You are welcome. This difference between Path Controller an Spline Controller is based on a choice done before my time at Curvy. I kinda get why this choice was done (once you look deep in the code it kinda makes sense), but I still want to get rid of that difference. Right now I am focusing on more important fixes, but maybe some time soon.
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
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 8 02-12-2024, 09:54 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
  Finding relative position across connected splines DekoGames 1 8 02-05-2024, 10:11 PM
Last Post: _Aka_

Forum Jump: