playMaker

Author Topic: Create an action when the Character is runing[SOLVED]  (Read 1357 times)

Franck

  • Junior Playmaker
  • **
  • Posts: 91
Create an action when the Character is runing[SOLVED]
« on: September 04, 2018, 11:21:58 AM »
Hello everyone,

I'm slowly learning Unity and Playmaker. Having no experience in development I admit to drool a little :)
I ordered a course on Udemy that allowed me to begin but it is obviously not enough.
So I installed playmaker to help me in programming without having to code.

Currently I test a little the possibilities (well mine instead). So I created a floor and put my FPS CONTROLLER with standard assets. My character can move around the world. I added arms and a weapon. This weapon can shoot and know if it made a hit thanks to Raycast. I can also right click and reach the aimed shouldered (thanks to animations).

Now what I want to do but can not do it is that the Character runs but can not shoot before resuming or being stopped.
I managed to make an FSM on the weapon by saying that if I press the LEFT SHIFT button my animation starts (animation that brings the weapon close to the body) and that the SHOOT and AIM FSM are disabled. Thanks to that, when I press LEFT SHIFT I can not aim and / or shoot anymore.
The big problem with this method is that even if I don't move and press LEFT SHIFT, my weapon goes as if I was going to run and inevitably prevents me from shooting and / or aiming.
What I want to do is make an FSM that makes it happen at a certain speed (according to the script FPS CONTROLLER I think?) My weapon plays the animation that sticks on the body and I can not no longer shoot and / or aim.

I hope I was pretty clear in my explanation, it's not necessarily obvious to make things clear to others when already in his own head it's confused lol

And sorry for my english, I'm French.

In any case, thank you in advance to those who will take the time to help me.
« Last Edit: September 05, 2018, 12:13:50 PM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Create an action when the Character is runing
« Reply #1 on: September 04, 2018, 02:31:45 PM »
Hi.
Don't worry, your english is very good :)

you might want to use an animation event.

the event that you want to set (or set state) must be on the same game object

The video below is a bit outdated as there will be no popup anymore, but it will be available in the inspector.
you can also check out this thread : http://hutonggames.com/playmakerforum/index.php?topic=19345.0


Franck

  • Junior Playmaker
  • **
  • Posts: 91
Re: Create an action when the Character is runing
« Reply #2 on: September 05, 2018, 09:05:55 AM »
Hello djaydino,

thank you very much for your quick response.

I was able to find the solution to my problem using the RigidBody prefab rather than the FPS CONTROLLER.

Now everything works as I wish. I could not get the variable SPEED because on the FPS CONTROLLER there is no RigidBody :)