A Imprint when a player touches an object

Hello, I want to make a feature so when a player touches a object it makes an imprint.

I want to make something like this, and after a small amount of time it slowly goes back to normal.

how would i accomplish this?

2 Likes

You could get the position of the player and the part it touches to spawn a part with a decal with the imprint in the exaxt point it touches the part.
So you can do:

script:

local part = workspace.Baseplate -- The part you want to make a footprint on here
local imprintPart = workspace.Imprintpart -- the part with the decal 
local disappearingTime = 5 -- the time you want to wait before the footprint disappear
local fireScriptEvent = game.ReplicatedStorage.fireScriptEvent

part.Touched:Connect(function(hit)
    if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        fireScriptEvent:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent), hit)
    end
end)

fireScriptEvent.OnServerEvent:Connect(function(plr, hitPart)
    local imprint = imprintPart:Clone()  
    imprint.Parent = workspace
    imprint.Anchored = true   
    imprint.Position = hitPart.Position
    wait(disappearingTime)
    imprint:Destroy()
end)

local script:

local fireScriptEvent = game.ReplicatedStorage.fireScriptEvent
local player = game.Players.LocalPlayer
local debounce = false
local debounceWaiting = 0.1

fireScriptEvent.OnClientEvent:Connect(function(hitPart)
    if debounce == false then
        debounce = true
        fireScriptEvent:FireServer(hitPart)
        wait(debounceWaiting)
        debounce = false
    end
end)

Basically what it does is to check if the part gets touched, if it gets touched by a player then call an event that checks if the debounce is false, so if it’s possible to create a footprint. If it’s possible then call an event that makes the server generate a print in the position of the foot that touched the part.

Sorry if I made some mistakes, but I wrote the code so fast. If you encounter some, please let me know.

I hope it helped!

1 Like

I don’t want a decal though, i want like terrain and when the player steps on it it carves a hole in the terrain and there is a part that the player stands on

I think this should help you from the replys

1 Like