Hi. I am not fully sure if this is possible, but if it is, how would i do it.
I am going to use the game Red Dead Redemption for this. (if you havent played it, i recommend it!!)
In Read Dead Redemption 2, there is a part in the beginning with snow, where there are footprints in the snow as you walk around.
In my game, i want to have a snow part, like in RDR2. How would i, make it so that the player leaves footprints in the snow. I am not the most experienced scripter, but i am guessing i would have to something with an Instance.New part?
Just make instance and wherever the player walks it gets the players feet and their main side and then makes a part the size of whatever you want and the color of whatever you want.
So what your saying is i would do something like this
while true do
script.Parent.Touched (function(hit)
wait(1)
local Footprint = Instance.new(“Part”) all the descriptions of the part here
Footprint.Position = hit.Parent.Foot
I would say use a raycast from the feet and use detection for more checks on snow. I know if you were to make real realistic footprints, it would be expensive and unnecessary when instead you could create something like a trail that you can extend time of and automatically clear up over time.
It’s not practically possible to do what RDR2 or Tomb Raider do for footprints in the snow. Roblox’s smooth terrain is too coarsely voxelized and triangulated, and the mesh is a single resolution. The effect requires that the terrain mesh be able to be subdivided and displaced at runtime, and retextured. Neither smooth terrain nor deformable meshes have this capability.
If you have a giant character, scaled up many times from a typical Roblox avatar, you could have it make huge footprints in smooth terrain snow just by replacing the impacted terrain with air, but the voxel size is 4x4x4 studs, so you don’t have the resolution for a typical avatar to leave 3D footprints.
What i reccomend you do is with your walking animations, create a Keyframe event when the feet are down called Footsteps. In a separate script, listen for the GetKeyframeReachedSignal() function to fire right when the feet hit the ground. Then, you can clone your footstep model and change the color with a raycast getting the instances color, and position it correctly.
Hope this helps.
I reccomend keyframe events because this allows you to place them exactily as your feet hit the ground, regardless of walkspeed and avoiding .Touched all together. Ofc you would want to make sure theres a part under you before.
and just to add onto this because this is a good way to do it: Use the “FloorMaterial” property of Humanoid. This makes it so you don’t have to do any raycasting or programming to find out if you are on Snow.
However, raycasting would be preferred as you would then have the normal and position of the ground below your feet so you can realistically place the footprints.
This will work, but of course only with your own animations. It’s not currently possible to support Roblox animations this way.
But this is more about detection of when footsteps occur, not what the OP was asking about, which is how to do 3D footprints and trails in deep snow like in Red Dead:
This sort of thing is not really possible in Roblox, because you can’t subdivide the terrrain mesh to add more polygons where you step, or displace them.