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 7 6,194 07-13-2025, 07:11 PM
Last Post: _Aka_
  Procedural Connections Janooba 3 2,329 10-23-2024, 02:53 PM
Last Post: _Aka_
  Invisible Gizmos In Latest Curvy Splines orrenravid1 1 1,521 06-11-2024, 07:36 AM
Last Post: _Aka_
  Help with procedural roads and splines ramiroflores 1 1,578 05-07-2024, 08:57 AM
Last Post: _Aka_

Forum Jump: