Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Walking on the Terrain
#1
I'm basically putting a camera on rails with Curvy and I want to use it for the path direction, but for the Y position I want it to be grounded to the terrain.

I've had a bit of success having a raycaster be applied on Update() that checks where the floor is, then adjusts the Y.  

But I feel like this is redundant.  Afterall, Curvy is already adjusting the transform, and what I'm doing is basically overriding the change Curvy JUST made.

Is there a setting somewhere that can have it check this?  Or how would you recommend I solve this problem efficiently?

Thanks for the support!
Reply
#2
Curvy has some build-in features that handle this:
  • The Conform Path CG module: this module allows you to project a spline onto colliders. This is most useful if your spline is modified at runtime.
  • The Camera Project action from the toolbar: Select multiple CPs and use this action to project them onto colliders using the Scene View camera looking direction. This is most useful to project splines at edit time, knowing that they will not have to be modified at runtime.
Does this meet your needs?
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
(05-09-2018, 04:01 PM)_Aka_ Wrote: Curvy has some build-in features that handle this:
  • The Conform Path CG module: this module allows you to project a spline onto colliders. This is most useful if your spline is modified at runtime.
  • The Camera Project action from the toolbar: Select multiple CPs and use this action to project them onto colliders using the Scene View camera looking direction. This is most useful to project splines at edit time, knowing that they will not have to be modified at runtime.
Does this meet your needs?

I will explore these!  

A question about the 2nd one, will that just make sure each CP is on the terrain floor?  Or would each point along the path also be 'walking' the floor?  Afterall, I already "raycast place" each CP anyway.  Sometimes I start to 'float' if my distant CP is higher, even just slightly.
Reply
#4
(05-09-2018, 04:01 PM)_Aka_ Wrote: Curvy has some build-in features that handle this:
  • The Conform Path CG module: this module allows you to project a spline onto colliders. This is most useful if your spline is modified at runtime.
  • The Camera Project action from the toolbar: Select multiple CPs and use this action to project them onto colliders using the Scene View camera looking direction. This is most useful to project splines at edit time, knowing that they will not have to be modified at runtime.
Does this meet your needs?

I don't think I'm doing this right...


Attached Files Image(s)
   
Reply
#5
Sorry mythstified, I wrote you an answer after your previous message, but somehow didn't post it (maybe clicked on Preview Post instead of Post Reply). It contained information that would have avoided you your latest post.

Conform Path will project the whole spline, while Camera Project will project only the CPs, so in your case I think you will want to use Confrom Path.
Conform Path, like most CG modules, produce a Path and not a Spline. To have an object following it, you will need to use a Path Controller, and not a Spline Controller. Based on your screenshot, you will have to add a RasterizePath module, and then select that path in your Path Controller. The example scene 20_CGPaths shows a usage of RasterizePath.
One last thing, the Confrom Path (like other CG modules) assume that your spline is a child of the Generator, and has a default transform (no translation or rotation). So if the spline is not a child of the Generator, make both their transforms equal and things will work correctly.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Forum Jump: