How can i keep a part under the player's feet?

Add a texture object into your Baseplate with a stud texture that you can find or upload:

I found one that looked exactly similar, then scaled it up with StudsPerTile properties.

Then add this part to where I had the orientation:

mover.Texture.OffsetStudsU -= character.Humanoid.MoveDirection.X * (humanoid.WalkSpeed * .01)
mover.Texture.OffsetStudsV -= character.Humanoid.MoveDirection.Z * (humanoid.WalkSpeed * .01)

Full script:

--!strict


local character: any = game:GetService("Players").LocalPlayer.Character
local humanoidRootPart: any = character.HumanoidRootPart
local humanoid: any = character.Humanoid

local mover: any = game:GetService("Workspace"):WaitForChild("Baseplate", 3)
local texture: any = mover.Texture

local rate: number = 0.01 -- 100 times a second
local accumulated: number = 0

game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
	accumulated += deltaTime
	while accumulated >= rate do
		accumulated -= rate
		mover.Position = Vector3.new(
			humanoidRootPart.Position.X, 
			0,
			humanoidRootPart.Position.Z
		)
		texture.OffsetStudsU -= humanoid.MoveDirection.X * (humanoid.WalkSpeed * .01)
		texture.OffsetStudsV -= humanoid.MoveDirection.Z * (humanoid.WalkSpeed * .01)
	end
end)

Here’s how the final product looks like:
result

3 Likes

Yes, this is EXACTLY what I was wanting, thank you so very much for your time, it means so much to me.

2 Likes

You’re most welcome!

By the way, I made a small edit to the solution script that takes WalkSpeed into account, should be good now.

2 Likes