playMaker

Author Topic: Running avatar animations with a trigger FSM  (Read 13747 times)

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Running avatar animations with a trigger FSM
« on: July 20, 2015, 01:53:45 PM »
Can somebody can help with this one I am new to playmaker .I have an VR avatar (fencer) in the scene running an idle animation, with the trigger i.e. a cube  as trigger so when I enter that cube with sword object  ( ie near the hand so I get the appropriate parry)it triggers  the  appropriate defensive action (animation) in the fencer  . I have looked at all of the posts and worked through the open door  scenarios and mecanim tutorials et cetera but there is still something missing !! Weather in my mecanim animator bool set up or type of playmaker event , can somebody please shed some light on this or show me an FSM that will work ! I am probably missing something really simple, so all the details would be really helpful !!! Thanks 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #1 on: July 20, 2015, 02:25:07 PM »
Hi,
do you have the animator package (with a whole bunch of animator actions)
if not you can get them on the EcoSystem

if so are you using the action "set animator bool" ?

if yes, play you project, go to the animator window and switch the bool manually to check if the animation changes.

if that works, test the trigger while you can see the animator.

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #2 on: July 21, 2015, 09:13:46 AM »
Hi djaydino thanks for helping out ! I have all of my own animations.
Im not sure how to switch the bool manually, have one trans set to true and back to false, at its simplest .Ive added a couple of pics that may help !
Im a very new newbie .. so you may need to spell it out !  :)
Best Hugo
« Last Edit: July 23, 2015, 10:15:10 AM by Hugo111 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #3 on: July 22, 2015, 10:52:58 AM »
Hi,
when you play the game you can click on the check-box of your bool you made (Parry Quarte 1)


the action "Set Animator bool" value is set to false maybe it should be set to true (checked box) and every frame is not needed.

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #4 on: July 22, 2015, 11:40:00 AM »
Hi Dino mmm checking the box on/off , by the ( Parry Quarte 1) bool  in the animator window doesnt change the animation to Parry Quarte 1 .

So i have one bool Parry Quarte 1
Transition from Idle small good ,Conditions Parry Quarte 1 True
Transition from Parry Quarte 1 to Idle small good False
??
H

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #5 on: July 22, 2015, 06:29:03 PM »
Hi, i think there might be something wrong in the transitions settings
if you have exit time enabled try to disable that.

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #6 on: July 23, 2015, 10:27:40 AM »
Thanks Dino did that, no go, back to the drawing board, ill just start again with  new animations and Fsm etc probably  something very simple :/
Would be a good idea if playmaker did a tutorial on it !! Best Hugo
 

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #7 on: July 23, 2015, 11:19:04 AM »
Dino, ok so changed animations, the bool on/of now in animator  window works :)
but still wont change with the trigger in the FSM fencer .
So set state to Specify game object to fencer Yes.. and parameter to bool action name.
Should that come up automatically in parameter drop down .
because it doesn't
Best H   

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #8 on: July 24, 2015, 04:06:15 AM »
Hi,
No it does not.
Make sure the game object connected has the animator on it, if not you can target it by clicking on "use owner" then click "specify Game Object" drag in the game object which has the animator on it.
And make sure the parameter name matches of course :)

While playing you can use alt+mouse (pc)or command-mouse (mac i think, i am on pc myself) on the next state to force it to go to that state.
You can also do this if there is a global transition on a state.

Try this on you action that has the animator bool.

If that works then there is probably something wrong with the trigger

another tip : when you right click a state you can select and  toggle a breakpoint,
this will pause your game when it hits that state, very helpfull when debugging :)

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #9 on: July 25, 2015, 06:52:25 AM »
Hi Dino Ive tried all of those things !
But my Set Animator bool sill doesnt function via trigger or alt mouse .
I have a play sound on that trigger that does work.
Tried every combo now :/
I am getting this error message though ?

Animator has not been initialized.
UnityEngine.Animator:SetBool(Int32, Boolean)
HutongGames.PlayMaker.Actions.SetAnimatorBool:SetParameter() (at Assets/PlayMaker Animator/Actions/SetAnimatorBool.cs:95)
HutongGames.PlayMaker.Actions.SetAnimatorBool:OnEnter() (at Assets/PlayMaker Animator/Actions/SetAnimatorBool.cs:67)
Best Hugo

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #10 on: July 27, 2015, 06:10:40 AM »
I now have the ecosystem downloaded hoping that may show me a working template but alas i cant seem to get that working is in my project files, but cant find it in my playmaker addons bar or anywhere else ?  H

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #11 on: July 27, 2015, 07:40:26 AM »
HI Dino at last a measure of success ! But ...
So i have bool ticked in animator window, trigger sets off from default state idle
(to false in conditions) and new action works ( true conditions ) but then won't automatically go back to idle .
Do i need another FSM to do this ? Best H 
Still no ecosystem  :-\

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #12 on: July 27, 2015, 09:27:03 AM »
Hi,
for EcoSystem try hitting Alt-e if that does not work check if you have the folder "net.fabrejean" in you project.

yes it does not change state automatically so you meed to set it to false again.

you should check this video out.

This will sync to states and can be very useful i think.
So you can add a state in the animator after the parry animation and set the bool to false from the linked fsm

Hugo111

  • Playmaker Newbie
  • *
  • Posts: 45
    • UFENCEVR
Re: Running avatar animations with a trigger FSM
« Reply #13 on: July 28, 2015, 05:54:53 AM »
Hi Dino
Yes i tried the sync to states but they didnt work for me at the time, maybe a revist is in order.
I have an trigger exit with "set animation bool" parameter  back to idle state should that work ?? And is there a particular prefab for this  that i should be looking at in Ecosystem ?
Thanks Hugo

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Running avatar animations with a trigger FSM
« Reply #14 on: July 28, 2015, 09:28:20 AM »
Hi,
yes trigger exit should work.

I don't think there are prefabs on Ecosystem.

I will try to make a sample this week (a lot of work atm :s )

Bump if i have not replied by Friday .