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
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
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
  Updated package in 2022 LTS resulted in multiple errors scr33ner 2 1,719 01-13-2025, 09:32 AM
Last Post: _Aka_
  Moving Platform Kokoriko49 8 4,343 09-23-2024, 09:20 AM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 1,582 02-23-2024, 09:44 AM
Last Post: _Aka_
  Best practice for controllers slowing down/speeding up along the spline Curry 1 1,384 08-06-2023, 09:47 PM
Last Post: _Aka_

Forum Jump: