so. i made a footprint trail (like your walking leaves footprints) and put attachments at players feet. It worked really well, except the trail was +200 studs away from players cframe (footprints dont usually appear that far away from you in real life, so its a problem)
aanyway i made some example code to make this effect more visible. If you know anything that causes this or just wanna poke fun at how stupid i am, leave a comment
code in StarterCharacterScripts (like 20 lines of code)
local root = script.Parent:WaitForChild("HumanoidRootPart")
local humanoid = script.Parent:WaitForChild("Humanoid")
-- Setup
local attachment0 = Instance.new("Attachment")
attachment0.Parent = root
local attachment1 = Instance.new("Attachment")
attachment1.Parent = root
local trail = script:WaitForChild("Trail"):Clone()
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Parent = root
game:GetService("RunService").Heartbeat:Connect(function()
attachment0.CFrame = root.CFrame + Vector3.new(25,0,0)
attachment1.CFrame = root.CFrame
if humanoid.FloorMaterial == Enum.Material.Sand and humanoid.MoveDirection.Magnitude > 0 then trail.Enabled = true
else trail.Enabled = false end
end)
so roblox actually developed 2 separate cframe/position types called world cframe and position just because they wanted attachments to be set relative to parent
genius api decisions right there, 11/10
i dont think i would have figured this out without you lol. thanks to everyone else who responded too, you guys are awesome