How would I make only the top half of your body turn?

I’m making a fps system and I want to have the top half of the players body rotate to face the mouse, my problem with this is that I’m not sure how to only rotate the top half without rotating the legs as well.

3 Likes

Maybe something like setting the UpperTorso’s Waist’s Motor6D’s C0 to CFrame.new(0,0,0, Mouse.Hit)(Get the Mouse.Hit to the Server via RemoteEvent from the client)

1 Like

Alright, I’ll try that out.

Wouldn’t constantly firing a remote event to the server in a loop cause lag?

True, you could maybe send it like every .05 seconds? Better than every frame, but a bit choppy…
EDIT It would probably be better to just send it every .1 seconds and have the server move, say, a tenth of the way there every 0.01 seconds.

1 Like

It’s turning out a little wierdly.

The mouse is on the ground and I’m looking at the sky.

local Pos = Player:GetMouse().Hit.Position
Character.UpperTorso.Waist.C0 = CFrame.new(Vector3.new(0,0,0), Pos)

That is weird. I don’t know what’s causing it, I’ll look into it.

@ScriptingSausage you can make that with this script

script.txt (1.5 KB)

here’s what you will achieve robloxapp-20200821-2102146.wmv (763.2 KB)

you must place the script in starter gui

Hmmm. I’ve done this:

--server
script.Parent:WaitForChild("LocalScript"):WaitForChild("RemoteEvent").OnServerEvent:Connect(function(player, pos)
	player.Character.UpperTorso.Waist.C0 = CFrame.new(Vector3.new(0,0,0),pos)
end)

--client
function beat()
	local mouse = game.Players.LocalPlayer:GetMouse()
	script.RemoteEvent:FireServer(mouse.Hit.p)
	wait(1/30) --every 30th of a second(one frame for me)
	beat()
end
beat()

Both in StarterGui, with a RemoteEvent named RemoteEvent inside the local script.
It works okay for me, but I’m guessing it would cause some big lag.

1 Like

As for how to make your whole body not turn when you turn in first person…
I don’t know XD

1 Like