Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
access to Path Range
#1
Hi! I'm a new user to Curvy and am really enjoying it!

How would I programmatically modify the "Range" parameter in the Build Shape Extrusion script? I was expecting to find something like...

    GetComponent<FluffyUnderware.Curvy.Generator.Modules.BuildShapeExtrusion>().range

Also, is there a way to read to the position of an object that is attached to a spline via a Spline Controller? Something like:

    GetComponent<SplineController>().Position

Thanks,
J.
Reply
#2
Ok, I think I figured a few things out after spending bit more time with the API docs. "From" is essentially from where "Range" is derived.


This code does mostly what I want:



newPosition = splineControlled.GetComponent<SplineController> ().RelativePosition;

GetComponent<FluffyUnderware.Curvy.Generator.Modules.BuildShapeExtrusion> ().From = newPosition;


I'm trying to create a "reverse trail renderer" where the trail draws ahead of the spline controlled object. I was hoping to just connect the position of the spline controlled object to the From attribute, but the above code doesn't keep the generated mesh in sync with the spline controlled object; they meet-up about every third or fourth CP, but then the generated mesh races ahead.

I'm guessing this is an interpolation issue?
Reply
#3
I think I figured it out. Here is my working code if anyone wants to do something similar:

        public GameObject splineControllerObject;
        public float controllerPosition = 0;

        void LateUpdate () {
                float position = splineControllerObject.GetComponent<SplineController> ().Position;
                float length = splineControllerObject.GetComponent<SplineController> ().Length;
                controllerPosition = position / length;
                GetComponent<FluffyUnderware.Curvy.Generator.Modules.BuildShapeExtrusion> ().From = controllerPosition;
        }
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked Change spline path at runtime burn0815 7 392 05-27-2021, 08:27 PM
Last Post: _Aka_
  Create a path with Curvy from a "position" animation with several keyframes mc_deimon 1 150 05-20-2021, 10:04 AM
Last Post: _Aka_
  Spline Shape not centering around Spline Path tfunitydev 3 348 05-13-2021, 08:50 AM
Last Post: _Aka_
  Is it possible to generate an output spline after the conform path module? bennidhamma@gmail.com 3 400 03-21-2021, 06:37 PM
Last Post: _Aka_

Forum Jump: