Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BocuD authored Jul 18, 2021
1 parent 42c78a7 commit cd4d4bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The spline data will be stored in the Positions, Tangents and Normals arrays and

Since you can't use AddComponent in Udon, you will need to prepare a prefab of an empty GameObject with the CatmullRomSplines script added. To generate a spline, use either `SetupCatmullRom` or `SetupCatmullRomVector` and supply it with an array of Transforms or Vectors. This will generate the spline data. To update the spline data at runtime, use `UpdateControlPointTransforms` or `UpdateControlPointVectors` and supply new data. `UpdateResolution` can be used to change the resolution or toggle the closed loop setting and will reprocess the spline data. When using these at runtime, be careful to not call any of these unless absolutely necessary, or reduce the resolution / control point count since Udon is quite slow.
`GetWorldSpacePosition` returns an interpolated world space position for t on the spline. It can be used to (for example) make objects follow the spline.
Takes about 0.03ms, depending on the way the spline is set up and the distance between control points.

**Examples**

Expand Down

0 comments on commit cd4d4bc

Please sign in to comment.