Hey guys this is my first tutorial expect me to make some mistakes if possible try correcting me i will try my best to describe everything in this tutorial.
anyway i am gonna be showing you how you can animate 2 characters and play it in-game. Like a takedown animation
here is an example of a roblox takedown animation:
game is “Right 2 Fight” by Rolve
but how are you gonna do it? well its simple but hard and takes time
so i will be explaining them step by step
also do note that there may be other methods to do it but for me personally i find the method i am using suitable
also sorry if some of the video isnt working.
The method is using 2 different animation and play them at the same time so it looks like a takedown animation
and also you must atleast know scripting and know how to use moon animator as it is the only animator (i think) that support multiple characters and we will be using it
i think you should also know how to animate
if you dont know one of these you may be confuse in this tutorial
Step 1
open your studio and add 2 Dummy (can be R6 or R15 whatever you prefer i will be using R15)
you can name them like, the first one will be the main and the second one will be the enemy (it is important to name them and it also prevent confusion)
then make both dummy face each other and then put them atleast 5 stud between each other or any stud you want, i recommend 5 stud, you can do it along the Z or X axis and this stud part is very important as you will be position the dummy 5 stud from you later on when we will try to play the animation in game.
here is an image of how it look like:
i hope you know how to do that. i simply position one in a random position lets say 60,0,0 then i position the other one like 65,0,0 and then rotate them so they can face each other
Step 2
open moon animator create an animation folder Then you can add both rigs/characters:
you add the rig by pressing the “+” sign
here is a video how you can add the rigs:
Now you can animate them
i will just make a simple animation and by simple i mean this:
Now you can export it
It will be exported as 2 Different animation
if you wouldnt have named them, then you would be confused on which is which
now when you have both animation ID and you also know which animation is for who, like the main animation is for the player and the enemy animation will be for the dummy, you can now start scripting
Step 3
once we add the animationId to the animations lets save the animations in a folder and also parent the folder to a remote function or event i will go with remote function as i want to return stuff to the client
then go to server script service and add a script and then add these lines:
Do note you can change the script mine look bad to be honest.
local animHandler = ----your remote function or event
local animationFolder = ----your animation folder
animHandler.OnServerInvoke = function(plr,enemy)
local mainChar = plr.Character
mainChar.Humanoid.WalkSpeed = 0 ---make the player not able to move, its a bad method tbh
---remember where i said the stud part is important well here it is, it position the character by making it face the dummy and make the dummy face you then put its position relatively 5 stud away from you so that it can play the animation properly and perfectly
mainChar.HumanoidRootPart.CFrame = CFrame.new(mainChar.HumanoidRootPart.Position,Vector3.new(enemy.HumanoidRootPart.Position.X,mainChar.HumanoidRootPart.Position.Y,enemy.HumanoidRootPart.Position.Z)) ---make plr face the dummy
enemy.HumanoidRootPart.CFrame = mainChar.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) -- position the dummy to teleport to 5 stud from you
enemy.HumanoidRootPart.CFrame = CFrame.new(enemy.HumanoidRootPart.Position,Vector3.new(mainChar.HumanoidRootPart.Position.X,enemy.HumanoidRootPart.Position.Y,mainChar.HumanoidRootPart.Position.Z)) ---make dummy face the plr
local Animation1 = mainChar.Humanoid:LoadAnimation(animationFolder.main) ---the player animation
local Animation2 = enemy.Humanoid:LoadAnimation(animationFolder.enemy) ----the enemy animation
task.wait(.5) ----this is optional i am making the script to wait just so both animation can load
Animation1:Play()---play both of the animation
Animation2:Play()
Animation1.Stopped:Wait() ---wait for the player animation to finish then make the player move again(i recommend you to wait for the player animation to finish and not the dummy)
print("finish")
mainChar.Humanoid.WalkSpeed = 16
return true ---returning a true to the client
end
In the script above in the positioning part there is many ways to do it. i just used the easy one
and now for the local script add it in StarterPlayerScripts.
note that this script will invoke the remote event that plays the animation when you press the F key near a dummy.
you can change this script/or use another script if you want
local input = game:GetService("UserInputService")
local remoteEvent = --- your remote event
local char = game.Players.LocalPlayer
local debounce = false
input.InputBegan:Connect(function(key)
if debounce then return end
if key.KeyCode == Enum.KeyCode.F then ---if player presses F
for i,v in pairs(workspace:GetChildren()) do
if not v:FindFirstChild("Humanoid") then return end ---if its not a dummy end the script
if (char.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude <= 10 then ----if the player is closed to a dummy
debounce = true
remoteEvent:InvokeServer(v) ---using a remote function will yield the script till the server return a value thats why i wanted to use a remote function so the server wait for the animation to finish then it returns a value
wait(2) ---wait a couple of second to prevent spam
debounce = false
else
print("you are far from enemy bruh!") ---you are far from the enemy bruh
end
end
end
end)
and done!
now i can bully some dummy just by pressing F near them
yes i made 2 animation and also ik the animations are trash cuz i am scripter not animator
you can also add multiple stuff to your animation like camera, sound effect, damage ,or anything else you want. mine is just a tutorial
I hope it helps. if there is part that is confusing or anything else feel free to tell me ill try my best to answer it
also if you want to try the game here → TakeDown animation Testing - Roblox