How to make camera & arms movement like in Phantom Forces?

Hi Developers! :wave:

** I really wanted to have that camera and arms following the player camera feature to see what the player is looking at. There is a lot of guides how to make this, but they don’t include how to move arms and they’re client sided!**

The problem is that I don’t have any idea how would I do it! I would appreciate any help provided, especially some code samples! :blush:

Here are some examples of what I’m trying to achieve:


Here is the game: Phantom Forces - Roblox

1 Like

you can get a target cframe with math.atan2(differenceY, differenceX) or CFrame.lookAt(from, to) and then lerp the C0 cframes of the joints that control the arms of the character to that target

do that on the client and send the cframes to the server which sends the cframes to other clients and then those clients will move the arms on their side

1 Like

can you show me some rough examples of it if you can?

And I need to use IK constraints for arms if I understand correctly, am I right?

--example

--client 1
local armCFrames -- assume this exists
remote:FireServer(armCFrames)

--server
remote.OnServerEvent:Connect(function(sender : Player, armCFrames : {any})
  for _, client : Player in ipairs(game.Players:GetPlayers()) do
    if client == sender then continue end -- everyone else except sender
    remote:FireClient(client, sender.Name, armCFrames)
  end
end)

--every other client except client 1 receives the message
remote.onClientEvent:Connect(function(senderName, armCFrames)
  updateArmCFrames(senderName, armCFrames) -- updates only the arms of the person with the name of senderName
end)

and youre supposed to change the motor6ds inside the torso
image

1 Like

Thank you a lot! I’ll try it next week bc I have no spare time rn :sweat_smile:

I will put a solution mark if it’s gonna work, sorry in advance for a late “solution”!