Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Position in path relative to Z world axis
#4
In other words you want to find the spline position that matches the same Z "depth" as the player, right? The best solution for this depends on the number of enemies, i.e. you should test different approaches for their performance. Ideas:

- Alter the enemy until the Z-delta (between player<->enemy) is near zero. If you use InterpolateFast() you'll only do lerps, so this should be reasonable fast. Sort of brute force approach
- Use GetNearestSplineTF() to get the spline point nearest to player. Could get wrong results depending on the curve, though. To speed it up, check the segments bounds and use GetNearestSplineTF only against those segments within near distance

I would stick to the first idea. You can further optimize it by iterating manually over the cached points (stored in CurvySplineSegment.Approximation[]) and compare their Z, then lerp between the two nearest points.
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rasterized Path Range issue proton 7 23 04-30-2024, 11:17 AM
Last Post: _Aka_
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 21 04-17-2024, 10:57 AM
Last Post: _Aka_
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: