Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a part follow the players camera and one follow their character?

I tried this before, but it doesn't do anything.

One part should be following the players camera (without the parts orientation being affected by camera orientation)

The other part should be on the players feet (without the parts orientation being affected by the characters orientation)

workspace:WaitForChild("Player_Name")

local part = script.Parent.c1winds

local BodyPosition = Instance.new("BodyPosition", part) 
while wait(0) do
    BodyPosition.Position = workspace["Player_Name"].Head.CFrame:pointToWorldSpace(Vector3.new(2, 1, 0))
end

Any solution?

1 comment

0

uhh i read none of that my head dizzy i eat lot

1 answer

✓ Accepted answer

dus dis work for u? Place in StarterPack

local player = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
local part = Instance.new("Part", workspace)
part.Transparency = .75 -- cus its rly annoying to have a part shoved at ur face and u cant see anything
part.Anchored = true
part.CanCollide = false
part.Size = Vector3.new(1,1,1)

local part02 = Instance.new("Part", workspace)
part02.Anchored = true
part02.CanCollide = false
part02.Size = Vector3.new(1,1,1)

player.CharacterAdded:connect(function(char)
	wait() -- wait for root to load
	local root = char:FindFirstChild("HumanoidRootPart")
	
	game:GetService("RunService").RenderStepped:connect(function()
		part.CFrame = cam.CFrame * CFrame.new(0,0,-part.Size.z)
		part.Orientation = Vector3.new(0,0,0)
		part02.Position = root.Position
	end)
end)

5 comments

0

it works, but the part that follows the character should stay where its at and not follow the player on the y axis, plus use :Connect(), :connect() is deprecated

0

wait when will :connect be removed?

0

ik its deprecated and all but its really nice to type things in lower case

0

:connect() will be removed eventually, once people get used to it.

0

lol oof ok

This discussion is preserved as it was. New answers, comments, and votes are closed.