Hello, I have a problem and I don’t know how to solve it.
when I want an object to change its rotation to the orientation that I want, but when I change some characteristic of 0, 0, 0 of vector the orientation goes down instead of forward.
The script chases the mouse but the orientation goes down instead of forward, which is what I want, help me.
local mouse = game.Players.LocalPlayer:GetMouse()
local targetPosition = mouse.Hit.p
local currentPosition = isEquipped and rightArm.Position or torso.Position
local lookVector = (targetPosition - currentPosition).Unit
local upVector = Vector3.new(0, 1, 0)
local rightVector = lookVector:Cross(upVector).Unit
local newRotation = CFrame.lookAt(currentPosition, currentPosition + lookVector, upVector)
rightArm.CFrame = newRotation