Hello Devs, I am working on a new catch system that’s based on the torso movement controlled by the mouse. I’m stuck in a place where I want to just move the torso itself instead of the whole body but I’m not sure how i’d achieve that. My goal is to achieve being able to only move/rotate the torso instead of the whole body. Please help.
Server Code:
-- Services --
local Players = game:GetService('Players')
local Replicated = game:GetService('ReplicatedStorage')
--
-- Main --
local Remotes = Replicated:FindFirstChild('Remotes')
--
Remotes.Catch.OnServerEvent:Connect(function(Player,MousePos)
local Character = Player.Character
local PrevHit
--
if MousePos ~= PrevHit then
Character.Torso.CFrame = CFrame.new(Character.Torso.Position,Vector3.new(MousePos.X,MousePos.Y,MousePos.Z))
PrevHit = MousePos
end
end)
--
Client Code:
-- Services --
local Players = game:GetService('Players')
local Replicated = game:GetService('ReplicatedStorage')
--
-- Variables --
local Mouse = Players.LocalPlayer:GetMouse()
local Remote = Replicated:FindFirstChild('Remotes')
local PrevHit
local Click = false
--
-- Main --
Mouse.Button1Up:Connect(function()
Click = false
end)
--
Mouse.Button1Down:Connect(function()
Click = true
end)
--
Mouse.Move:Connect(function()
if Click then
Remote.Catch:FireServer(Mouse.Hit.p)
end
end)
--