Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spline Approximation List
#1
Hi,

I am trying to get a object to slightly travel in front of the main gameobject that I have travelling on the spline.


I am wondering how to get the halfway point between two control points perhaps using the approximation list.
public Vector3 lookAtTarget;
public Vector3[] looktargets;
    public void SwitchtoNextFlightSegment(CurvySplineMoveEventArgs e)
    {
        looktargets = e.ControlPoint.Approximation;
        CurvySplineSegment controlPoint = e.ControlPoint;

                int listposition =  Mathf.RoundToInt((Manager.gamesystem.scPlayer.Position * 1.1f) * looktargets.Length);  //10% more on the list;
                lookAtTarget = looktargets[listposition];
             
               ...
             // look at position in playercontroller
               ...

}

wondering what is the best practice for looking ahead down the spline from current position..  Thanks!
Reply


Messages In This Thread
Spline Approximation List - by skyboard - 07-01-2018, 05:23 PM
RE: Spline Approximation List - by _Aka_ - 07-01-2018, 10:59 PM
RE: Spline Approximation List - by _Aka_ - 07-01-2018, 11:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Smile Constant speed along a spline? tfishell 1 193 11-13-2025, 11:32 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 3,323 07-29-2025, 09:15 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 7 4,756 07-13-2025, 07:11 PM
Last Post: _Aka_
  Is there a way to get the position of each ControlPoint in spline by API? Chanon 1 1,750 06-07-2025, 09:44 AM
Last Post: _Aka_

Forum Jump: