Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving multiple controllers at once
#6
Yep, in hell until Wednesday. Then I will be in purgatory (installing everything on my new pc) for some time.

  1. I have no environnement to test in, but here is my guess of the code you need:
    Code:
    var selectedControllers =Selection.transforms.Select(t => t.gameObject.GetComponent<SplineController>()).Where(c=> c != null).ToList();
    if(selectedControllers.Count > 1)
    {
    //your stuff
    }
  2. As far as I know you can't tell Unity to do special operations when updating a value from multiple selected objects in the inspector
  3. I think the easiest is to just create a new script with a position slider, and when the values is modified (see OnValidate above) execute you code that will get all the selected controllers and modify their positions accordingly
  4. You can simple convert the value of the position slider I spoke about in point 3 from the 0;1 range to another range, before assigning the value to the controllers, to make sure that all controllers stay in their valide range
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
Moving multiple controllers at once - by Lupp_ - 01-15-2020, 07:46 PM
RE: Moving multiple controllers at once - by _Aka_ - 01-18-2020, 10:01 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: