Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using curvy for camera pathing, through a procedural level
#3
I'm still having the most basic of issues. I can see how all the example levels work, but they're all pre-setup in the editor. I'm trying to do stuff completely in code because the game levels are generated at runtime. I get stuck pretty much right at the start trying to do something like...

GameObject cameraGO = MyCamera.gameObject;
cameraGO.AddComponent<FollowSpline>(); 

I can get it to work using SplineWalker as the component to add, but the docs say to not use this.
Even if I set this part up in the editor (adding the FollowSpline via the editor) I can't figure out how to access the component at runtime...I would have expected this to do it: someGO.GetComponent<FollowSpline>()...

Is there some sample code for how to do this?





 

I figured out that to access this stuff, you need to specify the entire path to the code. So you do like this...
FluffyUnderware.Curvy.FollowSpline FS = cameraGO.AddComponent<FluffyUnderware.Curvy.FollowSpline>();
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 5 03-27-2024, 07:25 AM
Last Post: amutp

Forum Jump: