Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Direction wont change
#1
Hi,

I'm still testing Curvy and here is another issue: 

I wish to determine on my own the direction that should take my controller at an intersection. Basically, when there is a connection, if the next spline can be continued at right or left, I look at the tangentes to determine the best way from my terms. Well so I did that but even if I set my controller a new direction at -1, it keep to be at 1. I set some log on Curvy's script to find out where my direction could be erase, but I didn't found the issue.

Here he's the simple code where I assign the direction:

Code:
// Find new spline
int randomIndex = Random.Range(0, valideControlPoints.Count);
CurvySplineSegment controlPoint = valideControlPoints[randomIndex];
   
if (controlPoint != e.ControlPoint)
{
     e.Follow(controlPoint); // Follow the new spline

     // Set the controller to use the new spline            
     Controller.Spline = controlPoint.Spline;
            
     Controller.RelativePosition = e.TF;
     Controller.Direction = FindBestDirection(controlPoint, e.Spline, e.TF, Controller.Direction);
}
Reply


Messages In This Thread
Direction wont change - by lllApOlll - 03-07-2018, 11:33 AM
RE: Direction wont change - by _Aka_ - 03-07-2018, 12:52 PM
RE: Direction wont change - by lllApOlll - 03-07-2018, 01:32 PM
RE: Direction wont change - by _Aka_ - 06-01-2018, 03:34 PM

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 to get direction of last control point? _RicO 4 23 04-13-2023, 11:27 AM
Last Post: _Aka_
Brick Delete CurvySplineSegment from the start of a Spline causes UV's to change studentloan 5 7 06-14-2022, 03:14 PM
Last Post: _Aka_
  Can I change splines directly on runner controller via script? sikamaru 1 11 03-12-2022, 08:40 PM
Last Post: _Aka_

Forum Jump: