Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Freely move on spline
#2
Hi Jedibald,

thanks for supporting us!

(10-08-2013, 12:39 PM)jedibald Wrote: But I'd like to know if there would be a way to use Curvy to make a racer using splines as roads, and so to move freely on it and not being restrained on a line ?
There are several ways I can think of. The best way highly depends on your scenario:

* If you need physics, you're bound to colliders. So you'll need to use the road mesh (generated e.g. by the SplineMeshBuilder) as a mesh collider and rely on physics only.

* If you only want to move left or right (shooter style), the axis to strafe on can be found by using the spline's orientation and tangent (see CurvySplineBase.GetExtrusionPoint). For example, if you're road is 4 units wide, GetExtrusionPoint(myTFPosition, 2, 90) gives you the rightmost point of your road (angle of 270 or better "currentPos-Rightmost" gives you the leftmost point). On Left/Right, just move the car between the leftmost and rightmost position.

Hope that helps

Jake
Reply


Messages In This Thread
Freely move on spline - by jedibald - 10-08-2013, 12:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 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_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: