playMaker

Author Topic: How would I play an animation when player dies? [SOLVED]  (Read 8056 times)

lioncirth

  • Junior Playmaker
  • **
  • Posts: 74
Re: How would I play an animation when player dies?
« Reply #15 on: March 26, 2014, 04:56:01 PM »
Have you tried it with the animator component off and just having the animation component?

Moza

  • Playmaker Newbie
  • *
  • Posts: 8
Re: How would I play an animation when player dies?
« Reply #16 on: March 26, 2014, 09:00:44 PM »
I'm also having the same problems. When I use the Animator component it just plays the default animation and when I try using the Play Animation action or Stop Animation actions they don't work. I also tried just using the animation component where i removed everything and redone the animations and just had the Animation component on the Player and again the actions didn't work and not even the default animation worked.

spacerobot

  • Playmaker Newbie
  • *
  • Posts: 17
Re: How would I play an animation when player dies?
« Reply #17 on: March 26, 2014, 10:38:28 PM »
I just tried it with the animator component off and I got the same results. Any chance of posting a working example for something like this?

Moza

  • Playmaker Newbie
  • *
  • Posts: 8
Re: How would I play an animation when player dies?
« Reply #18 on: March 26, 2014, 11:09:56 PM »
Ok so I went back to square one and used the Animator again and let it play it's default animation (running) and have actually managed to get it to stop playing the animation by using the Animator Start Playback action. Yes, the Start playback not the Stop playback. Have no idea why this is working but it is.

lioncirth

  • Junior Playmaker
  • **
  • Posts: 74
Re: How would I play an animation when player dies?
« Reply #19 on: March 27, 2014, 04:58:05 AM »
I will try and get my game up - may not be till tonight though.

Mine works a little different as I have two characters in the scene. One further away and the camera goes to it and then it dies and goes back to the playable one.

In theory it should still work the same though

spacerobot

  • Playmaker Newbie
  • *
  • Posts: 17
Re: How would I play an animation when player dies?
« Reply #20 on: March 27, 2014, 01:09:23 PM »
I will try and get my game up - may not be till tonight though.

Mine works a little different as I have two characters in the scene. One further away and the camera goes to it and then it dies and goes back to the playable one.

In theory it should still work the same though

That would be very helpful!

spacerobot

  • Playmaker Newbie
  • *
  • Posts: 17
Re: How would I play an animation when player dies?
« Reply #21 on: March 27, 2014, 08:44:36 PM »
I got it working!

A little different method though than we were trying here.

I created an animation trigger in the animator called isDead.

At the end of the FSM chain on the Player object my state for "Player died animation" I set an action to set animation trigger and specified the trigger isDead.

In the animator I made a transition from Any State to Death and set the condition to the isDead trigger.

I then added an "Enable Behavior" action to the Player FSM "Player died animation" that disabled my character control script so the character doesn't continue to move while he is lying on the ground.

I'm not sure if this is most optimal way to do it but it works.

Lioncirth thanks for all your help. I appreciate it.


lioncirth

  • Junior Playmaker
  • **
  • Posts: 74
Re: How would I play an animation when player dies? [SOLVED]
« Reply #22 on: March 28, 2014, 02:19:12 AM »
Glad you got it working! :)

Something for me to remember when I use the animator!

No problem, good luck with the game and if you need anything let me know and ill see if I can help

traitorjoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: How would I play an animation when player dies? [SOLVED]
« Reply #23 on: July 05, 2014, 10:20:04 PM »
I've been beating my head against the wall all day with this problem.

@SpaceRobot - would you mind please explaining what you mean by "I set an action to set animation trigger and specified the trigger isDead"... I don't see any PlayMaker actions like this that work.