playMaker

Author Topic: How to switch animations after player picks up weapon  (Read 291 times)

qoallen13

  • Playmaker Newbie
  • *
  • Posts: 1
How to switch animations after player picks up weapon
« on: June 07, 2023, 08:44:13 PM »
Hi, I am needing help allowing my player to switch from idle to rifle idle when he picks up a weapon near by. I have created a player controller fsm, a player pickup fsm that is attached to the player and also using a fsm for the pickup game object. I have tried using events but its giving me an error Transition missing Target state. I am attaching the screenshots of my state machine below. I would like to use something that will allow me to play different animations based on which weapon I pickup, so a sword idle animation if he picks up a sword, but also a rifle idle animation if he picks one up.

https://drive.google.com/file/d/1_TPiS3FTudGV3fNoLNtHjRO4xstlfHPX/view?usp=share_link

https://drive.google.com/file/d/1CEC_C4c-29F7dbTATm17NvUdi8nMXng4/view?usp=sharing

https://drive.google.com/file/d/11cBNYqb4rozY8Jq-IEbvdCPA5MW_C91p/view?usp=sharing

https://drive.google.com/file/d/1mFvJ4GVjyfP_a9h0DOX1X_AorzgusHU6/view?usp=share_link

https://drive.google.com/file/d/1OnW7LbKf_sO4vmydH1V_iWwWondVVl6Z/view?usp=share_link

https://drive.google.com/file/d/1_ghEEYS3hiiayjHkBTkOmk7AXqSzZJ18/view?usp=share_link

https://drive.google.com/file/d/1NEZb5jDqP6EnnEWumrXgT_zkwhvWNLD8/view?usp=share_link
« Last Edit: June 07, 2023, 08:50:17 PM by qoallen13 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: How to switch animations after player picks up weapon
« Reply #1 on: June 08, 2023, 07:18:54 AM »
Hi.
Pickupweaponevent is not connected to a state, there for its giving an error.

maybe its better to handle the animation inside the animation with for example a int paramater.

if int 0 no weapon idle
if int 1 melee idle
if int 2 rifle idle

in PM you can do SetAnimatorInt to set the value