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
  Converting spline collider hit point to spline position jh092 7 111 06-26-2020, 09:48 PM
Last Post: _Aka_
  Null reference when spline controller added runtime jh092 1 77 06-19-2020, 09:21 AM
Last Post: _Aka_
  Simple Spline Extrusion GelsonBieber 1 205 05-08-2020, 01:47 PM
Last Post: _Aka_
  instantiate Spline Controller at runtime PretzelStudios 2 297 05-07-2020, 09:03 PM
Last Post: PretzelStudios

Forum Jump: