Hello guys! This is my first ever community resource for y’all, so apologies if I seem a bit inexperienced (it’s because I am)
What is Mango?
Mango is a module that allows developers to play cutscenes made in an animation setting (aka Moon Animator or Roblox Animation Editor) inside of your ACTUAL game! (meaning while testing)
What does it look like?
Here is an example of a “domain expansion” respectfully inspired by the anime “Jujutsu Kaisen” made in an animation setting:
Here is the same animation but played in game!
How do I set it up?
1: Download the .rbxm file here
2: Drag and drop it into your roblox studio, I’d recommend putting it in your ReplicatedStorage
3: Make a local script titled whatever you want in StarterCharacterScripts
4: Inside that local script copy paste this code:
local CutsceneService = require(game.ReplicatedStorage.CutsceneService).new(
{
CameraObject = workspace.CurrentCamera,
VFXData = require(game.ReplicatedStorage.VFXData)
}
)
CutsceneService:ListenClient()
Change VFXData
to a module script containing your named functions (I’ll get to that later).
5: Create a module script in ReplicatedStorage, title it whatever but copy paste this code:
local VFXData = {
['rbxassetid:/youranimationid'] = {
['ExampleFunction'] = function()
print("This will run when the animation reaches the named keyframe above! (ExampleFunction)")
end,
['ExampleFunction2'] = function()
print("This will run when the animation reaches the named keyframe above! (ExampleFunction2)")
end,
['ExampleFunction3'] = function()
print("This will run when the animation reaches the named keyframe above! (ExampleFunction3)")
end,
End = function()
print("This will run at the end of the animation!")
end,
}
}
return VFXData
How do I actually use the service?
Create a server-sided script, title it whatever and copy paste this example script, you can modify it however you please but this is for demonstration purposes.
local CutsceneService = require(game.ReplicatedStorage.CutsceneService).new()
task.wait(10)
for _, players: Player in pairs(game:GetService("Players"):GetPlayers()) do
local VFXFolderClone: Folder = game.ReplicatedStorage.VFX:Clone()
VFXFolderClone.Parent = players.Character
for _, parts: BasePart in pairs(VFXFolderClone:GetChildren()) do
if parts:IsA("BasePart") then
local motor6d = Instance.new('Motor6D', players.Character:WaitForChild('Torso'))
motor6d.Part0 = players.Character:WaitForChild('Torso')
motor6d.Part1 = parts
end
end
CutsceneService:PlayCutscene(VFXFolderClone:WaitForChild('CameraRig'):GetFullName(), "rbxassetid://16456154300")
end
Important Notes:
In the server script where it has this line: VFXFolderClone:WaitForChild('CameraRig'):GetFullName()
The way I have my rig set up is that all the parts I need for VFX is inside one folder, including the part the camera will track for the duration of the animation.
The reason why it’s :GetFullName() instead of just passing the actual instance is because sending full instances to the client from the server doesn’t work for some apparent reason.
In the VFXData script, there is an “End” function, this function is necessary, you don’t need to have the function to do anything but as long as it’s a function and inside the table then you’re good. (Plus it’s good practice to include a clean-up function somewhere right?)
Final Notes:
This module is 100% still in it’s early stages, I will be happy to include any contributions and bug fixes found by you guys. There is no documentation but I will hopefully make one (and properly comment the code lol) if I have enough time or this module becomes decently popular.
Links:
Github: https://github.com/jun-ro/Mango
Youtube (if you needed more clarification): https://www.youtube.com/watch?v=CrgT88OF7JM
Updates:
- I’ve added support for multiple players, you can select from the player list to selectively play the cutscene for.
Credits:
Trove - @sleitnick
Loadstring - @kosukeReboyX