#tool vibrating my character or smth, weird visual bug
4 messages · Page 1 of 1 (latest)
could try lerping it sligthly
local function updateRotation()
local mouseHit = mouse.Hit
local mousePosition = mouseHit.p
local cameraPosition = camera.CFrame.Position
local direction = (-mousePosition + cameraPosition).unit
local horizontalAngle = math.atan2(direction.X, direction.Z)
local verticalAngle = math.asin(direction.Y)
local newTorsoCFrame = CFrame.new(torso.Position) * CFrame.Angles(0, horizontalAngle, 0)
local torsoTweenInfo = TweenInfo.new(
0.3,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local torsoTween = TweenService:Create(torso, torsoTweenInfo, {CFrame = newTorsoCFrame})
torsoTween:Play()
rightShoulder.C0 = originalRightC0 * CFrame.Angles(0, 0, -verticalAngle)
leftShoulder.C0 = originalLeftC0 * CFrame.Angles(0, 0, verticalAngle)
end