Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't set CG Path Controller
#4
Hi,

I found the cause of the issue. Basically Unity offers a method in its API to search for objects of specific type. This is used to find the available generators when showing the popup list. The issue is that said method looks only for objects in scenes, and not in prefab stage (prefab editing scene). I have to go through all usages of this method in Curvy Splines and make sure it handles properly the prefab stage. This will take some time, and will be released in the next update.

Until then, here is a quick fix that you can include in your project:
  • Go to \ToolBuddy\Dependencies\DevTools\Extensions\Extensions.cs
  • Look for the following method:
    Code:
    public static T[] FindSortedObjectsOfType<T>() where T : Object
  • Replace it completely with this one:

Code:
public static T[] FindSortedObjectsOfType<T>() where T : Component
        {
            T[] result;
#if UNITY_EDITOR
            T[] componentsOfType = StageUtility.GetCurrentStage().FindComponentsOfType<T>();
            //handle includeInactive
            result = componentsOfType
                .Where(c => c is MonoBehaviour m && m.isActiveAndEnabled)
                .ToArray();
            //handle sortObjects
            result = result.OrderBy(c => c.GetInstanceID()).ToArray();
#else
            result = Object.FindObjectsByType<T>(
                FindObjectsInactive.Exclude,
                FindObjectsSortMode.InstanceID
            );
#endif
            return result;
        }

Please note that with this modification, Curvy Splines is nor more compatible with Unity 2020.3. This modification bumps the minimum compatible version to 2021.3. 

Please let me know if this fix worked for you or not.
If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day.
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
Can't set CG Path Controller - by j95677 - 10-02-2024, 08:22 PM
RE: Can't set CG Path Controller - by _Aka_ - 10-03-2024, 08:30 PM
RE: Can't set CG Path Controller - by j95677 - 10-03-2024, 09:39 PM
RE: Can't set CG Path Controller - by _Aka_ - 10-04-2024, 09:26 AM
RE: Can't set CG Path Controller - by j95677 - 10-04-2024, 06:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Duplicate Prefab along path rickgplus 1 1,549 01-23-2025, 10:09 AM
Last Post: _Aka_
  How to use CG Volume Controller j95677 5 3,628 07-17-2024, 07:15 PM
Last Post: j95677
  Rasterized Path Range issue proton 7 4,267 04-30-2024, 11:17 AM
Last Post: _Aka_
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 5,160 04-17-2024, 10:57 AM
Last Post: _Aka_

Forum Jump: