Hjalte,
@Hjalte@mastodon.gamedev.place avatar

I'm working on , a PS1-inspired car game about Yugoslavia.

We really needed a way to quickly make tracks & roads.
🧵Here's what I came up with!

video/mp4

Hjalte,
@Hjalte@mastodon.gamedev.place avatar

It works by taking a strip of road and essentially duplicating it along the spline, but moving the vertices based on the tangent at that point.

This was necessary to ensure we could maintain control over the mesh (see curb)

video/mp4

Hjalte,
@Hjalte@mastodon.gamedev.place avatar

You can also rotate points on the spline (I included an option to use world up to ensure flat road)

video/mp4

Hjalte,
@Hjalte@mastodon.gamedev.place avatar

Since it's using Unity's splines, we can also use the included features, like spawning objects along the road

video/mp4

Hjalte,
@Hjalte@mastodon.gamedev.place avatar

Eventually I noticed there would sometimes be a little gap on closed tracks, so now it can generate an extra piece between first and last verts. So satisfying😌

image/png

Hjalte,
@Hjalte@mastodon.gamedev.place avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • gamedev
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines