I want it to follow the target... just like bodygyro be rotating when it follows a part
charTorso.C1 = tTorso.C1 * CFrame.new(Vector3.new(0, 0, 0), charTorso.C1.lookVector) * CFrame.Angles(tTorso.C1.y, 0, 0);
I want it to follow the target... just like bodygyro be rotating when it follows a part
charTorso.C1 = tTorso.C1 * CFrame.new(Vector3.new(0, 0, 0), charTorso.C1.lookVector) * CFrame.Angles(tTorso.C1.y, 0, 0);
Motor6D is generally used for Animations with Humanoid, so that won't quite be useful to make a Part follow another.
The smoothest way to make a part follow another is to Weld them instead
game.Players.PlayerAdded:Connect(function(player)
local character = workspace:WaitForChild(player.Name)
local root = character:WaitForChild("HumanoidRootPart")
local part = workspace.Part
local weld = Instance.new("Weld")
weld.Name = "Weld"
weld.Parent = part
weld.Part0 = part
weld.Part1 = root
weld.C0 = CFrame.new(0, 0, 5)
end)
The C0 Property determines the Offset from the welded parts The "part" that is welded to the player must be unanchored
The above example defines the action when the player is added, but this isn't the only function you can use.
thats good but i'm talking about following a part like the humanoidrootpart of another player
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Please read this to write better questions: https://scriptinghelpers.org/help/how-post-good-questions-answers
Do you want a part / block to always be following a player? If so, let me know and i'll post a response.
yeah but using C1