Unable to cast vector3 to float

Hi, im trying to bug fix my script, however, i have no idea how to fix this

local target = v.Character
					local distance = (part.Part.Position - target.HumanoidRootPart.Position).Magnitude
					if distance <= MaxDistance then -- Checks if target is in range
					part.Part.CFrame = part.Part.CFrame:Lerp(target.HumanoidRootPart.CFrame, step * Velocity/distance)  -- line causing the issue
					part.Part.CFrame = CFrame.new(part.Part.Position, target.HumanoidRootPart.Position) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) -- moves rocket towards target
					end

There is not enough information about Velocity here. That is possibly a Vector3 and needs converting.

2 Likes
local Velocity = Vector3.new(velocityDirection.X, 0, velocityDirection.Z)

so it is a vector 3 however idk how to convert it

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