playMaker

Author Topic: Playmaker and Animator moving character with touch  (Read 240 times)

redfirm

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Playmaker and Animator moving character with touch
« on: July 06, 2018, 06:06:02 AM »
Hi, i am trying to build a system where my character moves to a point i click to on the map. i got the whole system, the object moves to the point i click. i just don't  have the slightest clue on how i can assign an animator to this. so what i want to do is have the animator play a animation of walk when the character walks to the object. and have the idle animation when he reaches this. i have been searching for two days non stop and i cant seem to figure this out.

i would be grateful of someone could help me out with this.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3376
    • View Profile
    • jinxtergames
Re: Playmaker and Animator moving character with touch
« Reply #1 on: July 06, 2018, 09:48:58 AM »
Hi.
there are many tutorials for the Animator (unity)

and to manipulate the variables on the animator, there are several "Set Animator..." actions

For example when you click on the map, do also a "Set Animator Bool" and set the variable (call it 'walking' for example) to True
Then when the object arrives, do the same "Set Animator Bool" but then set it to false.

So in short in the animator :
Make a Parameter (Bool : 'walking')
Place your walk and idle animations in a state.

Make a transition from idle to walk.
Click the transition.
In the Inspector Click on + in the 'Condition' Part.
Set 'walking' to true.

Then do a transition from walk to idle and do the same, but then set it false.

You might need to do some other things to tweak the transition (for example turn off 'Has exit time' or adjust overlapping)