-
I’m in the progress of creating a bodycam shooter game heavily inspired by ready or not, my idol dev sensei, and the game bodycam (purchased on steam.) I’m trying to achieve the ability for the arms to move freely, not like a ragdoll but sort of like free hand. Once the player aims the cursor / aim should be centered and the arms should be in the same spot aiming like a cop would.
-
I have tried, but I’m not that experienced in coding so yeah.
-
**I’ve tried tweaking my code, and yes, I did look for solutions all around the devforum and everywhere, but I cannot understand how to do it. I would
like some guiding on how to achieve this effect. **
--General Updating--
runService.RenderStepped:Connect(function()
--Arm and character pointing towards mouse stuff--
if equipped == true and mouse.Hit.Position ~= nil and currentCharacter ~= nil then
local rightX, rightY, rightZ = currentCharacter.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
currentCharacter.Torso["Right Shoulder"].C0 = (currentCharacter.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
tweenService:Create(currentCharacter.Torso["Right Shoulder"], TweenInfo.new(0.2), {C0 = (currentCharacter.Torso["Right Shoulder"].C0 * CFrame.Angles(-rightX, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))}):Play()
local leftX, leftY, leftZ = currentCharacter.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
currentCharacter.Torso["Left Shoulder"].C0 = (currentCharacter.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))
tweenService:Create(currentCharacter.Torso["Left Shoulder"], TweenInfo.new(0.2), {C0 = (currentCharacter.Torso["Left Shoulder"].C0 * CFrame.Angles(-rightX, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))}):Play()
end
--Crosshair updater--
if equipped == true and currentCrosshair ~= nil then
currentCrosshair.Crosshair.Position = UDim2.fromOffset(mouse.X, mouse.Y)
end
end)
this is the code I have so far for the arms to only go up and down, and it’s not very smooth. I would like it to go all around, freely.