Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trouble getting data
#1
Hi, I just started using the asset on a project.
I'm trying to get info like what current Control Point I am on and the local F of that segment.
So far I had no luck finding a way. 

What I'm trying to achieve is to have the Spline Controller lower the speed gradually once it passed let's say local F 0.8 (close to the end) so that by local F 1.0 (next control point reached) my speed would be 0. 

Right now, I've settled with slowing down after Control Point was reached, but I have connections along the spline and I would like to stop at control point so I can choose what the next spline is.

Also, how can I change the controller spline by just having some generic onscreen buttons with go left, go right that would dynamically change the spline on click, according to connection info?
Reply
#2
Hi,

I guess you're using a custom controller then. If not, do that! A simple custom controller should be sufficient, see the controller section here for an overview. Then, for example in UserAfterUpdate(), you can use RelativePosition (it's actually TF for a SplineController) to get all the informations you need. CurvySpline.TFToSegment() gives you both the segment (and it's ControlPointIndex property) and the resulting localF on that segment.

You also can alter the Speed and the Spline property in UserAfterUpdate(). Also, consider using MetaData to get the needed speed or any other data needed (e.g. if the player can switch spline etc...). Tip: You are not bound to lerp values in your metadata class. The DTTween class (part of DevTools) gives you the usual easing methods used by all tweening libs.

Does that help?
Reply
#3
Tongue 
I somehow missed the Example Scripts folder.
If I still have trouble, I'll reply here.  Tongue
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting Data from a dirty module blackant 1 864 09-11-2020, 02:30 PM
Last Post: _Aka_
  Creating a Module / reading spline data puzzlekings 3 6,027 04-27-2016, 07:13 PM
Last Post: Jake
  CurvySplineGroup trouble thijsvn 3 5,881 01-27-2016, 07:22 PM
Last Post: Jake
  Having trouble moving projectiles from spline static2601 3 7,608 02-03-2015, 02:26 AM
Last Post: static2601

Forum Jump: