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
#2
Hi,
Instead of
Controller.Direction = FindBestDirection(controlPoint, e.Spline, e.TF, Controller.Direction);
use
e.Direction = FindBestDirection(controlPoint, e.Spline, e.TF, Controller.Direction);
This solution is not obvious, I agree. This is definitely something I want to make more obvious in future updates.
Let me know if it didn't work for you.
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
Yeah it works!

It's a bit confusing since you still have to do "Controller.Spline = controlPoint.Spline;" after using e.Follow()
Reply
#4
The above issue is fixed in the upcoming Curvy update.
This update will include a lot of improvements on controllers. It should be available in a couple of weeks
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
  best way to rotate, change offset, and inset position of splinecontroller object smackledorf 1 4 01-17-2022, 01:39 PM
Last Post: _Aka_
  Change Speed on spline linkinballzpokemon 1 9 12-29-2021, 10:58 AM
Last Post: _Aka_
  Change to Random Spline on End Reached Event ricke 10 976 09-14-2021, 12:31 AM
Last Post: ricke
  Autogenerate bezier curve with a given direction AnAsianPanda 3 551 08-06-2021, 09:08 AM
Last Post: _Aka_

Forum Jump: