how do i leave ruts on the road

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SDGN16

There is a skateboard in the game and I want it to leave a mark on the ground as it progresses. how can I do it?

:bust_in_silhouette: Reply From: skysphr

One way is to create a viewport, set it to use transparent background and set its clear mode to never, after which you can draw stuff on it that will remain there. To draw the viewport add a ViewportContainer node to the scene.

thank you for the answer. Is there a video or project for this?
(i say this for 3d)

SDGN16 | 2021-10-24 15:54

Just made this as an example, it’s 2d but should work in 3d as well. https://gitlab.com/skysphr/godot-car-tracks-example

skysphr | 2021-10-24 17:20

Thanks a lot for your help. But I couldn’t set the codes for 3d. I’m taking your time but how can I do this for 3d?

SDGN16 | 2021-10-24 17:40

You should be able to get it working by creating a MeshInstance with a plane geometry and setting its albedo texture to the texture returned by the viewport’s get_texture().

skysphr | 2021-10-24 18:16