function module.lookAtY(b,P)local v=P-b local r=Vector3.new(0,1,0)local x=v:Cross(r)local d=x:Cross(v)return CFrame.fromMatrix(P,-x,d)end function computeDirection(b)local P=b.magnitude*b.magnitude local v=1/math.sqrt(P)return Vector3.new(b.x*v,b.y*v,b.z*v)end local b=Instance.new("\080\097\114\116")b.Locked=true b.Size=Vector3.new(1,1,1)b.Shape=Enum.PartType.Ball b.Color=Color3.fromRGB(0,0,0)b.CanCollide=false

function module.lookAtY(target, eye)
    local forwardVector = (eye - target)
    local upVector = Vector3.new(0, 1, 0)
    -- You have to remember the right hand rule or google search to get this right
    local rightVector = forwardVector:Cross(upVector)
    local upVector2 = rightVector:Cross(forwardVector)
    return CFrame.fromMatrix(eye, -rightVector, upVector2) -- upVector2 - для вертикали
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

local Rocket = Instance.new("Part")
Rocket.Locked = true
Rocket.Size = Vector3.new(1,1,1)
Rocket.Shape = Enum.PartType.Ball
Rocket.Color = Color3.fromRGB(0,0,0)
Rocket.CanCollide=false
