Part rotation depend on Mouse.hit.p keep getting error

Hi, i working on my bow system, but i got this error
image

And when i added vector3 to mouse pos script the part face won’t face to mouse direction

Here server script

		local part; do
		part = Instance.new("Part")
		part.Anchored = false
		local mesh = script.Mesh:Clone()
		mesh.Parent = part
		part.Color = Color3.new(0.152941, 0.407843, 1)
		part.Material = Enum.Material.Neon
		part.CanCollide = false
		part.Parent = workspace
		part.CFrame = CFrame.new(weaponsheat.CFrame.p,Mouse)
		part.Size = Vector3.new(0.3,0.3,5)
		end
		local bv2 = Instance.new("BodyVelocity")
			bv2.Velocity = part.CFrame.LookVector * 25
		bv2.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		bv2.Parent = part
		canDamage = true

Here the local script

local function onInputBegan(input, gameProcessed)
	if not gameProcessed then
	if input.KeyCode == Enum.KeyCode.E then
		EquipSword:FireServer()
		elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
			local mousepos = mouse.Hit.Position
			print(mouse.Hit.p)
			Attack:FireServer(mouse.Hit.p)
		end
		
	end
end

Here when i added vector3.new

Oh, i think it because mouse not get the position but it get my name instend can anyone help me please?

replace this with

part.CFrame = CFrame.new(weaponsheat.Position, Mouse)
1 Like

Hi, thank for reply i replace it with your script but still got same problem, i think it because the mouse fire thing is detect only people name who clicked it
can you help with this one please?
Thank

Hm, ive made alot of projectile scripts before, mind if u give me the place file, or the tool? so i can take a good look at it

1 Like

It’s shooting the other way because it relies on the part’s front surface. I would get the directional value between Mouse.Hit.Position and the current position of the arrow.