How to make part always touch the ground below the player

I have a custom effect for developer, But i need the part that holds the emitters to always be on the ground, No matter how high the player is. It always needs to touch the ground. But i have some issues with it. So i need some help
Code:

			local rootpart = char.HumanoidRootPart
			local clone = game.ServerStorage.DevPlayerEffect:Clone()
			clone.Parent=rootpart
			clone.CanCollide=false
			clone.CanQuery=false
			clone.CanTouch=false
			clone.Anchored=true
			clone.Clusters.CanCollide=false
			clone.Clusters.CanQuery=false
			clone.Clusters.CanTouch=false
			clone.Clusters.Anchored=true
			clone.Transparency=1
			clone.UI.BillboardGui.TextLabel.Text=player.DisplayName.." ("..player.Name..")"
			clone.UI.Parent=rootpart.Parent:FindFirstChild("Head")
			rootpart.Parent:FindFirstChild("Head"):WaitForChild("VIPGui"):Destroy()
			while task.wait() do
				clone.CFrame=CFrame.new(rootpart.CFrame.Position)*CFrame.new(0,-2,0)
				clone.Clusters.CFrame=clone.CFrame
			end
1 Like

Unsure what this code is supposed to be doing.

Currently it places the part’s position (not rotation) at the player’s feet. But i want it to be on the ground.

You can raycast straight down from the player and use whatever position that hits as the position of the part. Raycasting | Roblox Creator Documentation

I unfortunately do not know how to use raycasts. Could u script it for me please?

You’re going to learn how to use raycasts eventually anyway so why not learn now? This is a good example script for learning them.

I would rather do it at a later point. So do u mind doing it for me? (i also learn a small bit in this way, rather than the roblox docs tutorials)

Please? It is difficult for me to learn new stuff that is poorly explained for me

The stuff roblox gave for me does not work. It does not want to make the part move on the ground under the player

U there? @azqjanna, I need your help.
It does not want to work.
image
Current code:

			local rootpart = char.HumanoidRootPart
			local origin = rootpart.CFrame.Position
			local Direction = Vector3.new(0,-20,0)
			local rayDirection = Direction - origin
			local Result = workspace:Raycast(origin, rayDirection)
			local clone = game.ServerStorage.OmniverseEffectPlayer:Clone()
			clone.Parent=rootpart
			clone.CanCollide=false
			clone.CanQuery=false
			clone.CanTouch=false
			clone.Anchored=true
			clone.Clusters.CanCollide=false
			clone.Clusters.CanQuery=false
			clone.Clusters.CanTouch=false
			clone.Clusters.Anchored=true
			clone.Transparency=1
			clone.UI.BillboardGui.TextLabel.Text=player.DisplayName.." ("..player.Name..")"
			clone.UI.Parent=rootpart.Parent:FindFirstChild("Head")
			rootpart.Parent:FindFirstChild("Head"):WaitForChild("VIPGui"):Destroy()
			while task.wait() do
				clone.CFrame=CFrame.new(origin)*CFrame.new(Result.Position)
				clone.Clusters.CFrame=clone.CFrame
			end