Hello! I have seen a similar problem to mine but have not been able to find a proper solution so I thought I would ask here. I have this animation that I want to use in my game. (I am using Moon Animator 2 to create it)
The problem that I am having is that the animation works as intended in the game, but the extra effects are not playing at all and I do not know what is causing this.
I have tried adding all of the objects into the player rig before exporting it (This seems to have actually gotten rid of a, “Sanitize ID” error I was having earlier) and have tried welding the parts to the character itself, though that caused me some issues and I aborted that path immediately. I do not know if this is entirely an animation uploading problem or a scripting one, so I will leave a script bellow for both the local and server script as well.
Local:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local buster = script.Parent
local replicatedStorage = game:GetService("ReplicatedStorage")
local runService = game:GetService("RunService")
local busterFolder = replicatedStorage:WaitForChild("Buster")
local busterFunction = busterFolder:WaitForChild("BusterFunction")
local RunService = game:GetService("RunService")
buster.Activated:Connect(function(otherPart)
local throwConnect = busterFunction:InvokeServer(otherPart)
if throwConnect == true then
local camera = workspace.CurrentCamera
local humanoid = character:WaitForChild("Humanoid")
local hrp = character:WaitForChild("HumanoidRootPart")
local head = character:WaitForChild("Head")
local function followHead()
humanoid.CameraOffset = (hrp.CFrame + Vector3.new(0, 1.5, 0)):ToObjectSpace(head.CFrame).Position
print("Following")
end
runService:BindToRenderStep("Follow", 1, followHead)
task.wait(3.5)
runService:UnbindFromRenderStep("Follow")
camera.CameraType = "Custom"
print("Throw connected")
else
print("Throw failed")
end
end)
Server
local replicatedStorage = game:GetService("ReplicatedStorage")
local busterFolder = replicatedStorage:WaitForChild("Buster")
local busterFunction = busterFolder:WaitForChild("BusterFunction")
local runService = game:GetService("RunService")
local contentProvider = game:GetService("ContentProvider")
local part = Instance.new("Part")
busterFunction.OnServerInvoke = (function(player)
print(player.Name.." called this function on the server")
local mainChar = player.Character
local humanPlayer = mainChar:WaitForChild("HumanoidRootPart")
local characterDirection = humanPlayer.CFrame
local cf = humanPlayer.CFrame * CFrame.new(0, 0.5, -0.5)
local size = Vector3.new(3, 1, 3)
local parameters = OverlapParams.new()
local characterDirection = humanPlayer.CFrame
local throwConnect = false
--Part is only for visualizing the hitbox for testing purposes
part.Anchored = true
part.CanCollide = false
part.CanQuery = false
part.CanTouch = false
part.CastShadow = false
part.BrickColor = BrickColor.new("Really red")
part.Material = Enum.Material.SmoothPlastic
part.CFrame = cf
part.Size = size
part.Transparency = 0.5 --Change this value to 1 to disable the hitbox and to 0.5 to see it
part.Parent = workspace
----------------------------------------------------------
parameters.FilterDescendantsInstances = {mainChar} --Filters out own character from being hit
parameters.MaxParts = 1
local hitbox = workspace:GetPartBoundsInBox(cf, size, parameters)
if #hitbox == 1 then --If Pot Buster hits we find the player who got hit then run the animation
local humanoid = hitbox[1].Parent:FindFirstChild("Humanoid")
if humanoid then
local enemy = humanoid.Parent:FindFirstChild("HumanoidRootPart")
throwConnect = true
local busterAnim = game.StarterPack["Ro-Buster"]:WaitForChild("Hit")
local buster = player.Character.Humanoid:LoadAnimation(busterAnim)
local busterVictimAnim = game.StarterPack["Ro-Buster"]:WaitForChild("Victim")
local victimAnim = humanoid:LoadAnimation(busterVictimAnim)
--Makes player face dummy
mainChar.HumanoidRootPart.CFrame = CFrame.new(mainChar.HumanoidRootPart.Position,Vector3.new(enemy.Position.X,mainChar.HumanoidRootPart.Position.Y,enemy.Position.Z))
enemy.CFrame = mainChar.HumanoidRootPart.CFrame * CFrame.new(0,0,-1) --Puts dummy 1 stud away
--Makes dummy face player
enemy.CFrame = CFrame.new(enemy.Position,Vector3.new(mainChar.HumanoidRootPart.Position.X,enemy.Position.Y,mainChar.HumanoidRootPart.Position.Z))
buster:Play()
victimAnim:Play()
end
else --If it misses play the whiff animation and put Pot Buster on a lengthy cooldown
throwConnect = false
local whiffAnim = game.StarterPack["Ro-Buster"]:WaitForChild("Whiff")
local whiff = player.Character.Humanoid:LoadAnimation(whiffAnim)
whiff:Play()
end
return throwConnect
end)
As always, any pointers are appreciated and if any more information is needed I can provide it.