Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving multiple controllers at once
#15
(02-02-2020, 05:43 PM)_Aka_ Wrote: Hi,
  • To set and get the absolute position, use the AbsolutePosition property.
  • To store them in an array, you can use a simple foreach. If you want to use Linq (warning, this means a memory allocation at each call), you can do this: Selection.transforms.Select(t => t.gameObject.GetComponent<SplineController>()).Where(c => c != null).Select(c => c.AbsolutePosition).ToList()
  • If I understood correctly you question about the end point, you need to use the CurvySpline.Length property
Yes I know this, you answered with the exact same line as I posted as example. Huh  What I need to know is what to actually type to get AbsolutePosition from the array you posted. I tried to look at some scripts that comes with the example scenes for some hints, but it's no good, I can't figure out how the syntax works. To make it clear, I know what to do, just not how. Big Grin 

What I meant by end point is the value of the final control point, that is the maximum value the controllers position can be/is clamped at.
Reply


Messages In This Thread
Moving multiple controllers at once - by Lupp_ - 01-15-2020, 07:46 PM
RE: Moving multiple controllers at once - by Lupp_ - 02-02-2020, 06:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_
  Best practice for controllers slowing down/speeding up along the spline Curry 1 5 08-06-2023, 09:47 PM
Last Post: _Aka_
  Moving object down or up the spline using gravity velikizlivuk 6 19 07-26-2023, 10:06 PM
Last Post: _Aka_
  Multiple Splines and Generators Performantly for Road System drock 1 6 07-17-2023, 10:31 AM
Last Post: _Aka_

Forum Jump: