Only scripts affecting the player movement I can think of are the custom top down camera script and the “look at mouse” script
Top down camera:
--Made by Beastcraft_Gaming
--Variables--
local TweenService = game:GetService("TweenService");
local player: Player = game.Players.LocalPlayer;
local character: Model = player.Character or player.CharacterAdded:Wait();
local humanoid = character:WaitForChild("Humanoid");
local humPart = character:WaitForChild("HumanoidRootPart");
local head = character:WaitForChild("Head");
local mouse = player:GetMouse();
local mousePosition
local camera = workspace.CurrentCamera;
local camHeight = script:GetAttribute("Cam_Height");
local movementOffset
local tweenTime
local maxDist
--Main
camera.CameraType = Enum.CameraType.Scriptable;
--camera.CameraSubject = humPart;
humanoid.AutoRotate = false
game:GetService("RunService").RenderStepped:Connect(function()
camHeight = script:GetAttribute("Cam_Height");
maxDist = script:GetAttribute("Max_Dist");
movementOffset = script:GetAttribute("Mov_Offset");
tweenTime = script:GetAttribute("Tween_Time");
local mouseCFrame = mouse.Hit;
--distance between character and mouse and it's unit vector
local dist = (mouseCFrame.Position - humPart.Position).Magnitude
local unitVector = (mouseCFrame.Position - humPart.Position).Unit;
--clamping the vector
local offsetVector = unitVector * math.min(dist, maxDist) * movementOffset;
--Applying the Offset
local newCFrame = CFrame.new(humPart.Position + Vector3.new(offsetVector.X,camHeight, offsetVector.Z)) * CFrame.Angles(math.rad(-90),0,0);
--Tweening
local goal = {["CFrame"] = newCFrame};
local tweenInfo = TweenInfo.new(tweenTime);
local tween = TweenService:Create(camera, tweenInfo, goal);
tween:Play();
end)
Look At Mouse script:
--Made by Beastcraft_Gaming
--Variables--
--Services
local replicatedStorage = game:GetService("ReplicatedStorage");
local RunService = game:GetService("RunService");
--Events
local LookAtMouseEvent = replicatedStorage:WaitForChild("Events"):WaitForChild("LookAtMouse");
--Player Variables
local player = game.Players.LocalPlayer;
local character = player.Character or player.CharacterAdded:Wait();
local humPart = character:WaitForChild("HumanoidRootPart");
local torso = character:WaitForChild("Torso");
local mouse = player:GetMouse();
local range = 10;
RunService.RenderStepped:Connect(function()
tweenTime = script:GetAttribute("Tween_Time");
local mousePosition = mouse.Hit.Position;
local dist = (Vector3.new(mousePosition.X,0, mousePosition.Z) - Vector3.new(humPart.CFrame.Position.X, 0, humPart.CFrame.Position.Z)).Magnitude;
if dist > range then
humPart.CFrame = CFrame.lookAt(humPart.Position, Vector3.new(mousePosition.X, 0, mousePosition.Z));
end
end)
Note: I have tried solutions like making humanoid.AutoRotate = false but no success
from what I read it seems you are setting the HRP cframe only when range is over 10 this maybe what is causing it sometimes because the humanoid is trying to move to new position but you are constantly resetting the cframe for rotation you might try using a AlignOrientation setup instead of setting the HRP cframe over what the humanoid is trying to do on movement to a position
also why are you referencing to Torso if I may ask?
I tried using AlignOrientation and it works perfectly but still having the movement issue.
here’s the updated script:
--Made by Beastcraft_Gaming
--Variables--
--Services
local replicatedStorage = game:GetService("ReplicatedStorage");
local RunService = game:GetService("RunService");
--Events
local LookAtMouseEvent = replicatedStorage:WaitForChild("Events"):WaitForChild("LookAtMouse");
--Player Variables
local player = game.Players.LocalPlayer;
local character = player.Character or player.CharacterAdded:Wait();
local humPart = character:WaitForChild("HumanoidRootPart");
local mouse = player:GetMouse();
local range = 10;
local attachment: Attachment = Instance.new("Attachment", humPart);
local alignOrientation = Instance.new("AlignOrientation", humPart);
alignOrientation.Attachment0 = attachment
alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment;
alignOrientation.RigidityEnabled = true;
alignOrientation.PrimaryAxisOnly = true;
RunService.RenderStepped:Connect(function()
local mousePosition = mouse.Hit.Position;
local dist = (Vector3.new(mousePosition.X,0, mousePosition.Z) - Vector3.new(humPart.CFrame.Position.X, 0, humPart.CFrame.Position.Z)).Magnitude;
if dist > range then
--humPart.CFrame = CFrame.lookAt(humPart.Position, Vector3.new(mousePosition.X, 0, mousePosition.Z));
local finalCFrame = CFrame.lookAt(humPart.Position, mousePosition);
alignOrientation.CFrame = finalCFrame;
end
end)
how are you actually moving the humanoid? is it using the default movement on click or do you have another script setting position for it like WalkToPoint or WalkToPart?
also depending on the full use case here you could just setup something like this letting the humanoid still control rotation with autorotate still on
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild('Humanoid')
local Down -- used as debouce and for continual set
Mouse.Button1Down:Connect(function()
if Down then return end
Down = true
while Down do
Humanoid.WalkToPoint = Mouse.Hit.p
wait()
end
end)
Mouse.Button1Up:Connect(function()
Down = false
end)
Also your humanoid moving looks like you have a BodyPosition in your humrp or torso that holds your character in one place.I don’t think it’s so because your camera script have some errors.
ok knowing what you are trying to do exactly now seems you will need to write a custom movement for the player by facing direction other than that only thing limiting the rotation is your 10 stud limit that i can see