Change Side Movement

Hello.

I am asking how to change the movement of a player’s character.
Please give this forum a reply if you have any ideas!

Currently:

What It Should Look Like:

I can’t view your videos they seem to be broken.

Try getting on your PC or Labtop…

Fixed… All you have to do is make the character follow the player’s mouse.

local Run = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Mouse = Player:GetMouse()

local OTS_CAMERA_SYSTEM = Player.PlayerScripts.OverShoulderCameraView["OTS Camera System"]

local IsEnabled = true
local IsBroken = false
local IsRunning = true -- Add this variable to control the loop

while IsRunning do
	task.wait(.2)
	if Player.OTSView.Value == true then
		if IsEnabled == true then
			local connection -- Add a variable to store the connection

			connection = Run.RenderStepped:Connect(function()
				if IsBroken == false then
					HRP.CFrame = CFrame.lookAt(HRP.CFrame.Position, Vector3.new(Mouse.Hit.Position.X, HRP.CFrame.Position.Y, Mouse.Hit.Position.Z))
				else
					connection:Disconnect() -- Disconnect the RenderStepped connection
				end
			end)

			IsEnabled = false
		end
	else
		if IsEnabled == false then
			wait(.1)
			IsEnabled = true
			IsBroken = true
			wait(.1)
			IsBroken = false
		end
	end
end

StarterCharacterScripts

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