playMaker

Author Topic: Animation did not play second time even its called.  (Read 136 times)

Croesus

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Animation did not play second time even its called.
« on: April 07, 2021, 03:00:01 PM »
Hello everyone. I am trying to prototype a turn base game and I am at the very beginning. I am trying to make the "select player and click a place than move thr player to the selected point" mechanic. I watched many tutorials and made this you can see in the video. But I have a problem. For the first time it works properly but when I clicked on the player second time the "walk" animation doesn't triggered. A second problem is I set a gameobject to a global variable but I can not see it in another FSM. There is a video that I can tell more clearly my problems. And you can see my FSMs properly. Thanks.

Here is the video:
https://drive.google.com/file/d/1Lz2CjzrmfntJnY9ouYqxL0iKd9FU61xg/view?usp=sharing
Note: The video is 1080p but if you see it is 360p while watching, please try to download it. It is only 22MB

The project file: https://drive.google.com/file/d/1dJzzWlr8hJS83TVrjPoabhsiNAkB-1gK/view?usp=sharing
« Last Edit: April 08, 2021, 01:22:35 PM by Croesus »

Weak Interactive

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
Re: Animation did not play second time even its called.
« Reply #1 on: April 08, 2021, 02:40:31 AM »
Hello, unfortunately I'm not familiar enough with your workflow to spot the issues, but it would probably help if you zipped your project file and uploaded that to google drive for people to take a look at. I do have some suggestions though.

Instead of using "Play Animation," I would look into using the animator and the "Animator Play" action. The animator (mecanim) is very easy to use with a bit of practice, and you'll be able to see the flow of your animation that way, so debugging will be much easier.

For your issue with the Global Variable not showing up in certain FSM's, I'm not sure about that either; however, I would recommend not using Global Variables at all. Instead, I would use a game object with the variables you need, and then use "Get/Set FSM [Variable]" actions to accomplish the same thing. I've experienced bugs with Global Variables in the past, and I've found that they're not necessary. Just attach an FSM with "Don't Destroy on Load" to the game object with the variables, and you can access them from any scene.

Sorry for not having any solutions, and good luck with your project.

Croesus

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Animation did not play second time even its called.
« Reply #2 on: April 08, 2021, 01:18:41 PM »
Thank you for replying and for suggestions. I will try mecanim animations with animator. And I will try the trick about global variables.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6098
    • View Profile
    • jinxtergames
Re: Animation did not play second time even its called.
« Reply #3 on: April 10, 2021, 10:28:53 AM »
Hi.
its indeed better to use the animator especially for characters.

its best to look to some animator tutorials to get familiar with it (even if they don't use playmaker)

as for example you can set a float variable and use that with transitions between walk and idle. (condition Greater than / Less Than )

in playmaker you can get the velocity of the character and use 'Set Animator Float'
to set it on the animator float variable.