Rotating a part as it is welded to a player [ Making a part always face another part when moving]

I’ve been trying to rotate a part / make it face a part as the player / the part is moving so its always looking at it. I’ve had alot of issues achieving that and wanted to head to the DevForum as I may find solutions here.
Current code I have right now:

 	local Direction = script.Parent.Parent:Clone()
	Direction.Name = "Direct"
	Direction.Anchored = false
	Direction.Parent = folder
	Direction.Position = workspace.Position.Position
	Direction.ClickDetector:Destroy()
	
	local Weld = Instance.new("Weld")
	
     Weld.Parent = Character
     Weld.Part0 = Direction
     Weld.Part1 = Character.HumanoidRootPart
     Weld.C0 = CFrame.new(-4.5,2,0) * CFrame.Angles(0,math.rad(-90),0)
	 script.Parent.Parent.Weld.Value = true

image

Instead of welding it you could just do that

RunService.RenderStepped:Connect(function()
    Arrow.CFrame = CFrame.new(Character.HumanoidRootPart.Position, Part.Position)
end)
1 Like

I tried using it and it works only in local scripts, I’m trying to use :FireClient someway to get this all set up.

Yeah, .RenderStepped is only meant to be used on client. However, you could use body gyro with body position on server but that wouldn’t be half as smooth as the method above is.

2 Likes

The method above doesn’t seem to work great for me as I’m using a script. It seems simple to just turn a part around to look somewhere but I have no clue what to use at this time.

1 Like