Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find a point a distance ahead on the spline?
#2
Hi,

maybe you didn't post the whole code involved, but what I see makes no sense. tfAtlastPoint seems to be unused and distBetweenPoints doesn't do what you expect because you're calculating the distance between a world position and a relative value (0..1).

The question is how do you want your collectibles to be placed? Equal F distance? Equal world unit distance?

Here's a pseudocode:

Code:
for (int i=0;i<31;i++)
{
    var myNewGameObject=new GameObject(...);
    myNewGameObject.position=SplineGroup.Interpolate(i/30); // <= this will be equal F
    myNewgameObject.position=SplineGroup.Interpolate(SplineGroup.DistanceToTF((SplineGroup.Length/30)*i)); <= this will be equal distance
}
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Spline Issue Leading to Unity Freeze Pankaj09 1 221 08-24-2026, 11:28 PM
Last Post: _Aka_
  Connecting Multiple Spline Nodes Issue Ritesh Kadam 1 173 08-22-2026, 11:24 PM
Last Post: _Aka_
  Spline Spots from 2 samples. BitBlit 8 1,108 06-30-2026, 11:49 AM
Last Post: _Aka_
  Best way to duplicate a spline with an offset Kapistijn 8 2,492 04-12-2026, 03:18 PM
Last Post: _Aka_

Forum Jump: