Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I modify generators during gameplay ?
#1
Hi, I'm stuck when it comes to trying to modify generators during runtime.

First I will explain what I'm trying to do. I create a set of unique generator objects in the game scene. Next I'm trying to use only some of these generators for different splines. I leave the "spline" input under the input spline path as none. But I cannot for the life of me figure out how to set the spline input for that generator reference via c#. Is it simply not possible to do that ?
Reply
#2
Hi
You will have to get the InputSplinePath module instance you are interested in, then modify its Spline property.
To get the InputSplinePath instance, you can use the usual Unity methods (such as GetComponent<InputSplinePath>()) or the CurvyGenerator.GetModule... methods while setting the optional parameter to true.
Did this work?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(09-02-2021, 12:52 PM)_Aka_ Wrote: Hi
You will have to get the InputSplinePath module instance you are interested in, then modify its Spline property.
To get the InputSplinePath instance, you can use the usual Unity methods (such as GetComponent<InputSplinePath>()) or the CurvyGenerator.GetModule... methods while setting the optional parameter to true.
Did this work?

Thanks for the fast response, this indeed worked Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compilation issues for iOS with a scene containing generators puzzlekings 2 625 05-13-2021, 06:53 PM
Last Post: _Aka_
  Generators placing referenced prefabs Horibe 8 5,982 07-05-2019, 10:40 AM
Last Post: _Aka_
  Easy way to modify the UVs of the generated mesh? douoht 2 3,123 01-06-2019, 05:15 PM
Last Post: douoht
  Setup Generators in code Leks1NL 2 4,090 07-29-2017, 05:52 AM
Last Post: Jake

Forum Jump: