08-17-2020, 10:59 AM
(This post was last modified: 08-17-2020, 01:01 PM by Maltakreuz.)
Hi! I am updating curvy from 2.0.4 to 7.0.0 and have some old code to move player along the spline. The most part of update went surprisingly well, but there are some places that are not that easy to rewrite:
1.
Unfortunately i can not find any new method like "MoveByLengthFast" to get new position for my player. Was it completly removed? Any new method like this?
2. I made some art of "tunnels" with splines, that can have forks with multiple spline segments connected to one point. My code to choose what path to take was like that:
But e.ControlPoint has no connected control points anymore. How do i get them now?
(onControlPointReachedEvent seems to by moved into SplineController, probably it is easy to rewrite it from spline)
3. What about old splines made with old curvy version? Well on the first look right seem to be OK. I can edit them as normal in Unity. Is it safe to leave them for new curvy version, or do i need recreate them from scratch?
1.
Code:
Vector3 pos = spline.MoveByLengthFast(ref tf, ref direction, spd * Time.deltaTime, CurvyClamping.Clamp);
Unfortunately i can not find any new method like "MoveByLengthFast" to get new position for my player. Was it completly removed? Any new method like this?
2. I made some art of "tunnels" with splines, that can have forks with multiple spline segments connected to one point. My code to choose what path to take was like that:
Quote:CurvySplineMoveEventArgs last_curvy_event = null;
void onControlPointReachedEvent(CurvySplineMoveEventArgs e) {
last_curvy_event = e;
}
foreach (CurvySplineSegment cp in e.ControlPoint.ConnectedControlPoints) {...}
But e.ControlPoint has no connected control points anymore. How do i get them now?
(onControlPointReachedEvent seems to by moved into SplineController, probably it is easy to rewrite it from spline)
3. What about old splines made with old curvy version? Well on the first look right seem to be OK. I can edit them as normal in Unity. Is it safe to leave them for new curvy version, or do i need recreate them from scratch?