Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 10:14 AM |
Trying to make a charging animation, and it works in studio. And when you join in the game it works until you reset. Then it shows the error stated in the title.
Any reasons why?
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
| |
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 11:16 AM |
Not sure, but I think it has something to do with this:
local animation = Humanoid:WaitForChild("ChargeAnim") local animationOn = Humanoid:LoadAnimation(animation)
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
| |
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 03:26 PM |
this doesnt work either
if Humanoid and animation then local animationOn = Humanoid:LoadAnimation(animation)
i tried to wait for them to load but still doesnt work, same error
|
|
|
| Report Abuse |
|
|
|
| 28 Feb 2016 03:27 PM |
| Just wait until its in the workspace. |
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 03:29 PM |
How much I go about doing that?
I tried this but it doesnt error anymore but it still doesn't work.
if animation.Parent.Parent.Parent ~= game.Workspace then repeat wait() until animation.Parent.Parent.Parent == game.Workspace
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 03:30 PM |
Sorry I meant 'How would I go about doing that?'
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 03:36 PM |
Well I just figured out that if I add a wait(2) to the script it works, but I don't understand why it doesnt work without. I 'WaitForChild()' almost everything
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 03:44 PM |
Fixed it! :DD
local animation = Humanoid:WaitForChild("ChargeAnim") repeat wait() until Character:FindFirstChild('Humanoid') and Character.Humanoid:FindFirstChild('ChargeAnim') local animationOn = Humanoid:LoadAnimation(animation)
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 04:09 PM |
nvm it didnt work but the wait(2) did :/
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 04:19 PM |
I've used prints to find out where it stops and the problem is differently this
local animationOn = Humanoid:LoadAnimation(animation) I don't know why though because I wait for everything to load
Things I load:
-- Loading assets --
-- Loading Character -- local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:wait() print('Character lol') -- Done loading, back to loading asssets --
local UIS = game:GetService("UserInputService") print('Input') local Humanoid = Character:WaitForChild("Humanoid") print('human') local Charge = Character['Left Leg']:WaitForChild("Charge") print('charge1') local Charge2 = Character['Right Leg']:WaitForChild("Charge2") print('charge2') local Remote1 = Character.Torso:WaitForChild("RemoteOn") print('remote1') local Remote2 = Character.Torso:WaitForChild("RemoteOff") print('remote2') local animation = Humanoid:WaitForChild("ChargeAnim") print('charge animation') repeat wait() until Character:FindFirstChild('Humanoid') and Character.Humanoid:FindFirstChild('ChargeAnim') print('waited') local animationOn = Humanoid:LoadAnimation(animation) print('loaded animation')
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
|
| 28 Feb 2016 04:22 PM |
Output:
Characterlol Input human charge1 charge2 remote1 remote2 charge animation waited -- Object must be in Workspace before loading animation. loaded animation
|
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
| |
|
|
| 28 Feb 2016 06:09 PM |
| So you are saying you are fetching an already existing animation and loading it to you plr humanoid. |
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
| |
|
|
| 28 Feb 2016 06:13 PM |
| I would just make the animation in the script so you don't have the hassle of looking for it. |
|
|
| Report Abuse |
|
|
Laxusss
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 6042 |
|
| |
|
|
| 28 Feb 2016 06:53 PM |
| You should use loadanimation the line before it plays. (If you're using an event, put the loadanimation line in the event) |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Feb 2016 05:21 PM |
Fixed! Apparently :LoadAnimation() doesn't wait for :WaitForChild() I'm guessing so I used a repeat wait in the beginning of the script so it doesn't even activate until it's been loaded.
Animation.Parent = c:WaitForChild("Humanoid") repeat wait() until Animation.Parent == c:WaitForChild("Humanoid") Skill.Parent = p.Backpack Skill.Disabled = false
|
|
|
| Report Abuse |
|
|
|
| 12 Jun 2016 04:11 PM |
| You need to wait the number of seconds the animation is in length EXACTLY in order to play another animation afterwards. <:^D |
|
|
| Report Abuse |
|
|