Cant get a road to curve on a path

So I want a road to follow a curve…here is what I did

  • made a small piece of the road, and put an array modifier on it. I set the origin on side part of the mesh (center)
  • made a path, set the origin of the path to the first vertex
  • put the road piece at the beginning of the path
  • put the curve modifier on the roadpiece, and selected curve

as you can see, it deforms the road completely, and it doesnt follow the curve… …no matter what axis I use… Im not sure what I am doing wrong here…

any pointers?

here is the blend file (2.8)

https://www.dropbox.com/s/xm67zhpu1ukltol/roadcurve.blend?dl=0

Select the road object.
Go in edit mode.
Rotate along Z axis 90°.
Change the array modifier relative offset (x,y,z) from (0,1,0) to (1,0,0)

The trick is to change the geometry rotation in edit mode, not object mode. Just make sure to keep gonig into object mode to see how it looks.
roadcurve_01.blend (787.1 KB)

ah I see, i messed up the rotation of the roadblock…

Fixed it, thanks!

@colkai @LazyVirus

ok so im running into the same damn problem again, for a different road.

Is there anyway to know how to set up the roadblock beforehand, so i dont have to rotate it or anything in edit mode? Or is it always trial and error?

Are there guidelines for this? For example… if you know the road is only going to be on a flat surface (x plane)… how would you orient the roadblock (also just flat on xplane) and what deformation axis would you use (i assume the X)

To be honest, I’ve always ended up trial and error, but I’m sure that’s just a lack of understanding on my part. Logically speaking, there must be a structure to it based on the object and curve axis. I imagine if I spent a while playing with various permutations, I’d figure it out. The first thing to check i guess is, is your curve rotated in object mode? Likewise your object? if you model a curve and object facing a set axis, what happens? Once you lock these things in, I suppose it becomes obvious which axis and alignment you select.

EDIT: Yep, just doen a quick test, basically, make sure your object and curve are along the ‘x’ axis, then everything is fine, if you change the orientation of either in object mode, things get funky pretty quickly. Just play about with this basic scene, rotate either on an axis and you’ll see what I mean. Also try chaging both in edit mode, if you alter the road profile direction in edit mode, it has a different effect to in object mode. also, if you rotate the curve on say the Z axis in object mode, thigns go awry, but apply the rotation and the road profile snaps back.
Select both and rotate together and the extrude/array holds true. So easy way is make the curve the parent of the road curve, then rotate the curve
280_CurveArrayTest.blend (603.1 KB)

If you array in x, curve in x.
Make sure that scale and rotation are applied (scale and rotate only in edit mode or press Ctrl+A > …) and that they share the same origin and put the curve’s starting point is in the origin.
This is the general rule, practically it may be necessary to make some trial and error.

1 Like

Thank you SO much for your reply

I did some tests based on your feedback, and i think my problem was the rotation/orientation of the curve in object mode, without reapplying the transformations. When you change anything about the curve, you need to apply those transformations. I didnt now that…

So i can replicate the solution and its working…but… i still dont know what im doing wrong with my initial file… As you can see, the road has the wrong orientation when I array it… The stripes are in the wrong way
Can you tell what i did different in this setup… ?

https://www.dropbox.com/s/slng465ubalcfn3/280_CurveArrayTest.blend?dl=0

When you scale/edit a curve, the curve radius of its points scale accordingly but when you apply scale to curve in object mode, the points’ curve radius doesn’t reset to 1.
So you have to do it manually:

  • Select the curve
  • Go in edit mode
  • Select all curve points
  • Right mouse button click > Set curve radius
  • Choose 1.0
  • Push the Enter Key
  • Enjoy
2 Likes

I had no clue this could be the problem…that totally solved it!
thanks so much, you guys are lifesavers