Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SplineController Move Speed
#1
I am using a Spline Controller and I am trying to make my object move at certain speed relative to the world size along a CSCircle spline. I am showing at runtime A Generated Mesh using the Curvy generator to show the path.

I am having a few issues
1) What are the "units" of speed, I don't really understand what this value represents?
2) The "world" speed seems to get faster the bigger my spline controller scale gets, I am guessing I need to change the radius to update the speed instead of the object scale?
3) Updating the radius at runtime makes it so I can no longer see the the path, however updating it in the editor I see the changes fine.
Reply
#2
1.) SplineController either uses TF or Unity world units, but...
2.) don't scale your controller and check wether your controller sets local or world coordinates
3.) You're updating the radius of the CSCircle shape by code or animation? If you use the Radius property the script should update itself (if not you've encountered a bug!). If you animate the value, be sure to call Refresh()
Reply
#3
What does the spline controller units mean, is it World Units per second?

Looks like the issue was 3 fold, Scaling the mesh was scaling the movement speed, I wasn't calling Refresh and the Shape Extrusion I was using wasn't thick enough to see.


However now I see a new issue. When I set the radius to something very small like .1224
The shape is no longer a circle put a pentagon.

This is with Path.Resolution = 200. Optimization turned off
are there other ways to make this circle more of a circle and this small resolution. (The object moves in a perfect circle..)
Reply
#4
Controller units are world units when you use an absolute movement mode!

To work with very small resolutions, you should check a few settings:

- CurvyGenerator.MinDistance. This will most likely solve your issue.
- CacheDensity of the shape spline

Does that help?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Changing speed between ControlPoints funkd 5 397 10-02-2020, 12:36 PM
Last Post: _Aka_
  SplineController slows down approaching connections jh092 5 437 08-07-2020, 03:56 PM
Last Post: _Aka_
  Move with constant velocity in Relative mode athos_k 3 443 07-21-2020, 11:39 AM
Last Post: _Aka_
  make "GetCurrentControlPoint" in SplineController more accessable VampirasuGameStudio 2 964 04-19-2020, 02:03 PM
Last Post: _Aka_

Forum Jump: