Leaving wheel tracks on the terrain

I can’t seem to find anywhere how to do this. I have a tank that rolls over soft dirt, and I would like to leave tracks behind it.

Im using Unity terrain.

Thanks for help.

hmmm look into this
http://blog.almostlogical.com/2010/06/10/real-time-terrain-deformation-in-unity3d/
gonna take a bit of experimenting

There is the TRAIL RENDERER in the EFFECTS components.
But this of course does not stick the vertexes in place, you’ll have to modify it.
If you are a coder with a little experience in mesh works it shouldn’t be too difficult.
And when you have it ready, please send it to me as I’m doing some stuff with tanks as well eh eh :smile:

I’ve done this before:

I could make an asset from it if there’s interest, though I’d have to clean it up, write docs, etc.

–Eric

Wow that looks quite cool!

I was thinking if there’s any way to pull this off from the particle system… going to try this right NOW as I’m too curious :smile:

Of course, it will be nothing continuous and well defined like a dedicated solution.

Done! And it’s not too bad! (as a placeholder :roll_eyes: )

Now I’ll try with the trail renderer.

Well trail is not good for this for 2 reasons: first, as said, it doesn’t “stick” the texture there, it trails it, and second, vertexes are oriented to the camera, and not flat or oriented like the terrain.

But particles are not too bad to start with.

I dont understand how can you use particles to achieve this effect?

I don’t want to deform the terrain tbh. I just want to leave a texture/flat trail on top of it.

1 Like

You can have the particle emitter right at the bottom of the wheel, and have a textured particle (a square piece of the track) which will face up and not billboard.

Emitter sphere radius 0.
Particles work in world space and speed=0.
Set the rendering as horizontal billboard.
Set the material as multiply.
Give the particles 20 seconds life.
Set alpha to full for the first 80% lifetime, and then put alpha to 0 at 100% lifetime.
Now, put one of these particles systems as children of your vehicle, at the base of the wheels.
NOT children of the wheels, or the particles system will rotate with them! LOL

This won’t work nicely if your vehicle is fast though, and it’s only something that leaves a trace… nothing as detailed as Eric’s solution, but it’s something that remains on ground where the vehicle passes.

Also, if your vehicle can jump, you will have to check if the wheel is in contact with ground or not, and deactivate/reactivate particles generation accordingly… or you will have trails on air :smile:

2 Likes

@Eric - would love a sentence or two on how you did yours. That looks pretty nice :slight_smile: I’m “in the market” for something similar at the moment, but for blood trails (as bodies are dragged around). Lovely, I know.

Basically I use the Mesh class to create quads using info obtained from raycasting. Seems like it would probably work for blood trails, since it’s not actually tied to vehicles per se; you attach the tire track script to each object you want to have a track (I found that only attaching it to the rear wheels generally looked better, at least for what I was doing, even if it’s not “correct”). It handles discontinuous tracks in case of wheels leaving the ground.

–Eric

Quite cool.
Any chance to see it on the Asset Store?
I think it would have a “market” :slight_smile:

Yep…I was probably going to do that at some point anyway, but I’ll bump it up higher on the list.

–Eric

That’s cool, make it a popular price and I’m going for it for sure :slight_smile:

thanks for help guys, Ill give particle system a shot.

Sorry for the necroposting… but this is the most relevant result I could find. I checked the asset store too, but couldn’t find anything there.

Did anybody ever make a good solution for this (leaving wheel tracks on the terrain)?

Unity standard assets have a car Controller with wheel tracks.

1 Like

This popped up in my Twitter feed today with the #madeinunity hashtag, looks like proper 3d tire marks, maybe it will appear as an asset soon, fingers crossed :slight_smile: