Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating old movement code
#1
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.
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?

[Image: f70a2711b7.jpg]
Reply


Messages In This Thread
Updating old movement code - by Maltakreuz - 08-17-2020, 10:59 AM
RE: Updating old movement code - by _Aka_ - 08-17-2020, 02:44 PM
RE: Updating old movement code - by Maltakreuz - 08-18-2020, 04:44 PM
RE: Updating old movement code - by _Aka_ - 08-18-2020, 04:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
Question Setting instantiated object to spline, then starting movement? _RicO 3 9 06-28-2023, 06:01 PM
Last Post: _Aka_
  Permission to publish custom CGModule source code? Apelsin 6 9,422 09-15-2022, 08:53 PM
Last Post: Josaf Tom
  How can I set the generator to stop updating? Chanon 3 19 09-08-2022, 02:54 PM
Last Post: _Aka_

Forum Jump: