Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add Volume to the Volume Controller Dynamically
#8
I forgot to say something important:
In the code above, I wrote:
Code:
TrackSpline.GetNearestPointTF(Controller.transform.position, out nearestPoint, out nearestSegmentStart, out nearestSegmentF);
This is misleading, because the first parameter of GetNearestPointTF needs to be the position in the local frame of the spline. In my code it is the position in the global (world) frame. The correct could would be:
Code:
TrackSpline.GetNearestPointTF(TrackSpline.transform.InverseTransformPoint(Controller.transform.position), out nearestPoint, out nearestSegmentStart, out nearestSegmentF);
The first version of the code worked because TrackSpline had a default transform, i.e the same transform than the world's, so the transformation did nothing. If TrackSpline's transform is modified, then the first version of the code would stop working correctly.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: Add Volume to the Volume Controller Dynamically - by _Aka_ - 04-17-2019, 10:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Volume Spots inter group distance Sacryn 1 3 02-27-2024, 04:08 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
  Newbie Question: Uniformly increase spacing between volume spots? SAMYTHEBIGJUICY 1 5 09-01-2023, 03:38 PM
Last Post: _Aka_
  Changing material of Volume spot at creation? _RicO 5 11 08-11-2023, 09:39 AM
Last Post: _Aka_

Forum Jump: