Goal:
I’m making a first person multiplayer game where players will be able to see their arms and others full character. Each character would have 2 animations for each action, one for 1st person and one for 3rd.
Issue:
While I’m able to create and play 1st person animations, I’m struggling on how to replicate 3rd person animations so that other players can see them.
Solutions I’ve tried:
My current approach is using remote events to tell players what animations should be played on what characters, but this can get complex when considering things like emotes, speed adjustments, tools, etc. Additionally, I’d be sending a lot of signals with a lot of arguments. So generally, I’m looking for a better way.
Thank you in advance for your response.
I would continue with Remote Events, My approach would be
local data = {
AnimId= 0,
Speed = 1,
Tools = {
Bat,
Grenade -- Idk hitting grenade with bat.
},
-- Your ect.
}
-- You could load the animations here.
AnimRemote:FireServer(data)
Then on the server you would receive that request and do a few checks to make sure it’s valid
AnimRemote.OnServerEvent:Connect(function(player, data)
if not data.EmoteId return end
-- Manipulate data table and add any VFX / SFX?
AnimRemote:FireAllClients(player, data)
-- The reason why the player is being passed through is because we will get the character
end)
Then on the client do something like
AnimRemote.OnClientEvent:Connect(function(player, data)
if player.Name == LocalPlayer.Name then return end
player.Character.Humanoid:LoadAnimation(data.EmoteId) -- Doesn't work but you get the idea
-- Create VFX / SFX.
end)
This way it keeps all the animations and everything on the client, giving you more performance on the server. If you really want to compressing data you can look into making your own networking library or using a networking library made by a community member.
I’d create fake clone of your body on client, that will play first person animations, and play third person animations normally (also on client). The original character would need to be hidden for client so they don’t see third person animations, I think first person already does that well.
Thank you guys for taking the time to respond. <3
There are some things about both approaches that concern me though.
@McGamerNick
Your approach is very similar to what I’m doing now. It would cover emotes and actions. However, say we want the player to have the default running animation. The running animation speeds up and slows down based on the characters movement speed. If we use only remote events, we’d have to send a signal potentially every frame telling other clients to update the speed of the animation.
A potential solution is having other players play the movement animations based on the humanoid state, but then what about animations that change speed and aren’t based on movement. And if I’m using state to determine the animation, would it be better to do the same for other animations like emotes?
@whiplash3r
Your approach, I believe, is what’s most commonly used in Roblox’s fps games and definitely makes things easier. Since animators automatically replicate the animations, each player will control their own 1st and 3rd animations without remote events. But, this entails that there would be a extra animator playing an animation on an extra model the player will never see. I would like to avoid this if at all possible. Thank you still for your answer though.
1 Like