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
  Spline.Length not updated unless I add a point to spline (or modify it) first. _RicO 3 6 08-26-2023, 08:41 AM
Last Post: _Aka_
  Multiple Splines and Generators Performantly for Road System drock 1 6 07-17-2023, 10:31 AM
Last Post: _Aka_
Question How to modify Example 12 to work bi-directionally and more than 2 connected splines Mambosa 3 17 11-29-2022, 06:59 PM
Last Post: _Aka_
  Compilation issues for iOS with a scene containing generators puzzlekings 2 912 05-13-2021, 06:53 PM
Last Post: _Aka_

Forum Jump: