I’m trying to use a TrailMesh to create the tire tracks behind a car in the sand. I use a textured material with 2 separate tracks on it for each side of the car.
I got it working, but I notice the trail is setup like a triangle, which distorts the texture a bit, when moving diagonally.
Is there a way to make the trailmesh to be lower (or even flat on the ground) ?
I also tried using CreateRibbon to create the tire tracks, but I couldn’t get this working. The updating of the vertices was a bit too complex for me.
In this example, you can move a box with WASD-keys. You can see the trail is shaped like a diamond.
In my game, I have the point origin of my mesh set to the center-bottom of the mesh, so it appeared as a triangle to me.
I would like to ‘flatten’ the triangle, to make the trail mesh not appear as a threedimensional shape, but as a flat ribbon on the ground.
Thanks a lot, I couldn’t find how to set the number of sections. The constructor I used, doesn’t have this. Unfortunately VSCode with Typescript doesn’t accept the other constructor with the options-parameter.
Would you happen to know how to set the options in another way than in the constructor?
I cannot use the last one, because VSCode / eslint doesn’t allow me to. It gives an error, since it expects the TrailMesh to be created with diameter and length as parameters, instead of with the options object.
There must be a way to set the number of sections in another way, I think?
can you reproduce that? sorry, I just joined the conversation so I might have missed something along the way
Internally, the constructor is checking what the type of the variable is and makes sure to initialize the class with the right parameters. in JS it should work without an issue, in typescript as well (though it infers the type from the parameters passed, so you need to be sure you are passing the right type/object).
Well, the problem with VSCode not recognizing both constructors is solved now (since upgrading the BabylonJS version). My Vite/eslint setup gave a warning about it, but not anymore.
I can’t reproduce the empy trailmesh I got with 7.13.1, so I guess this is solved too.