Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the animation only play when the model is a child of workspace and not Player.Character?

Asked by
neoG457 315 Moderation Voter
9 years ago
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

enabled = true
Mouse.KeyDown:connect(function(key)
if not enabled then
        return
    end
if key == "q" then

local GhoulReleaseAnim = Instance.new("Animation")
GhoulReleaseAnim.AnimationId = "http://www.roblox.com/Asset?ID=277277616"
local animTrack = Player.Character.Humanoid:LoadAnimation(GhoulReleaseAnim)
animTrack:Play()

wait(0.25)  

local BikakuModel2 = game.ReplicatedStorage.BikakuTwo:Clone()
local primary_part = BikakuModel2.HumanoidRootPart
BikakuModel2.PrimaryPart = primary_part

local w = Instance.new('Weld')
w.Part0 = Player.Character.HumanoidRootPart
w.Part1 = primary_part
w.Parent = Player.Character.HumanoidRootPart
w.C0 = CFrame.new(0,  -0.25, -0.5)*CFrame.Angles(0 , math.pi/2, -math.pi/6)
primary_part.Anchored  = false

BikakuModel2.Parent = Player.Character
BikakuModel2.Name = Player.Name.."Kagune"
enabled = false

local ReleaseAnim = Instance.new("Animation")
ReleaseAnim.AnimationId = "http://www.roblox.com/Asset?ID=277254720"
local animController = BikakuModel2.AnimationController
local animTrack = animController:LoadAnimation(ReleaseAnim)
animTrack:Play()

local Release = Instance.new("Sound")
Release.SoundId = "http://www.roblox.com/Asset?ID=268375598"
Release.Volume = 10
Release.Parent = primary_part
Release:Play()

BikakuModel2.Segment0.Secretion.Enabled = true

wait(0.5)

local IdleAnim = Instance.new("Animation")
IdleAnim.AnimationId = "http://www.roblox.com/Asset?ID=276949625"
local animController = BikakuModel2.AnimationController
local animTrack = animController:LoadAnimation(IdleAnim)
animTrack:Play()

BikakuModel2.Segment0.Secretion.Enabled = false

end

    end)

The animation for BikakuModel2 Only plays when it is a member of workspace but not when it is a member of Player.Character please help me with this.

Answer this question