Problem with arrow looking at player

I’ve been searching for an answer for hours on how to make the arrow look at the player correctly, and i can’t find anything.

The issue is that the arrow is somehow rotated and I can’t find anything to solve this.

I’ve tried looking for an answer using chatgpt, youtube videos and roblox devforum.

local newArrow = script.Parent.arrow.Handle:Clone()
		newArrow.Parent = workspace
		newArrow.Name = "ArrowClone"
		newArrow.CanCollide = true
		newArrow.Anchored = true
		
		
		local object = newArrow
		local speed = 5
		
		local players = game:GetService("Players"):GetPlayers()
		local pickedPlayer = players[math.random(1, #players)]

		while true do
			
			local playerPos = pickedPlayer.Character:FindFirstChild("HumanoidRootPart").Position
			local objectPos = object.Position
			local direction = (playerPos - objectPos).Unit
			local distance = (playerPos - objectPos).Magnitude

			if distance > 2 then
				object.CFrame = CFrame.lookAt(object.Position, pickedPlayer.Character.HumanoidRootPart.CFrame.Position) -- if the code has a problem, i think it would be on this line. I'm not really experienced on CFrames yet.
				object.Position = object.Position + direction * speed * math.min(distance, 1/60)
			else
				newArrow:Destroy()
				break
			end

			wait()
		end

me personally i think it may be a problem with the mesh itself, did you model it in blender yourself or just download it or is it a model? I would guess it’s a problem with the lookvector of the part. or maybe change the way the “Handle” is orientated?

3 Likes

a friend of mine modelled it, i will ask him and I’ll see if he can do anything about the model and i’ll also see if the problem is the orientation or the lookvector, thank you!

update: the problem was indeed the handle of the arrow and it is now fixed. Thank you again for your help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.