Announcement

Collapse
No announcement yet.

How to fire Boolean on input change?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to fire Boolean on input change?

    Hello!

    I've been creating a character locomotion system, and I'm stuck on something. Id like to know when My input axis changes from zero to something else, and from something else to zero. That way I can tell my anim graph when to blend in my start and stop animations. The other problem is that when the axis changes I need to fire a Boolean to true, and then back to false after a certain delay. I know I can achieve similar results with start and stop animations by putting them in a state between Idle and walk, but the way my anim graph works it wont allow this. Im trying to keep my animgraph low on transition logic, responsive, and flexible. Any help would be greatly appreciated!
    (PS. Im am an animator, not a programmer, and am still learning blueprint.)

    Thanks In Advance!

    #2
    If you do not want to go through the anim notifies why dont you do an event tick that checks if input axis = 0. Branch from there and set the bool based on true or false.
    However add a do once that resets bases on the branch value.

    That way it will only set it once, and then back as opposed to continually firing it.
    Will add some screenshots if it doesn't make much sense.
    http://celestialarch.com
    Free UE4 things available. More coming

    Comment


      #3
      Screenshots would be great! Will It also work backwards? I only need the bool to return true when the axis changes from zero to another value, and another bool to return true when the axis changes to zero. Both bools only need to be true for a second

      Comment


        #4
        You only need one bool.
        Also have you considered using a simple blendspace 1d?

        Seems what you are looking for is a blendspace1d which can be setup to use your axis mappings. But considering you talking about stop / start animations im not sure if there is a design issue behind going that route as you said you want to keep transition logic minimal.

        Anycase. Here is a screenshot of setting the bool. If the axis mapping is 0 then it sets the bool to true. If its less or greater than then its false.
        You can always use 2 different setups just saying if bool is true, do this. If bool is false do this.

        As opposed to setting 2 bools.

        The do once node is in there to prevent your tick event from setting the bool the entire time which just creates extra system utilization. So rather cut it off there. Even though it might be insignificant, as a game grows its better to optimize as you go, as opposed to looking for bottlenecks.

        Click image for larger version

Name:	test.jpg
Views:	1
Size:	154.5 KB
ID:	1066087
        http://celestialarch.com
        Free UE4 things available. More coming

        Comment


          #5
          Hmmm. Even still I don't think that this will work. In my case, Ive got a 2d blend space with Idle, Walk, Jog, and turning animations. Instead of transitioning to another state to do the stop/start animations, Ive bot a Bend by Bool node that affects the final animation. Basically, when a Bool returns true, the blend by Bool node will blend in my Start/Stop animations (I have another blend by bool node that determines wether it is starting or stopping) and when it is false, It will be playing my 2d blend-space. All of this is contained in a single state, so It can be transitioned out of at any time by a single transition. So I need to somehow get a bool to return true for a certain period of time when Input goes from zero to one, and from one to zero, and then back to false. I also need another bool to determine wether it left zero, or became zero.

          Sorry if this is confusing. Ill post screenshots when I get home.

          Comment


            #6
            The principle should be the same. I used a similar setup as above, perhaps a bit more elaborate to create a melee combat animation system for a character.
            Those animations are all triggered based on bool states. Well and combining anim notifies with bools to get the best results.

            As with Axis mappings its user input dependent which created a lot of bugs if not using root motion in my setup. So you need to experiment a lot to fix those bugs as well.
            I ran into this issue with my melee combo animations.

            Post some screens. Someone here will have the answer. And i like seeing what others are doing and learning from that.
            http://celestialarch.com
            Free UE4 things available. More coming

            Comment


              #7
              Here are parts of my anim graph. Hope this helps explain my situation!

              Click image for larger version

Name:	AnimGraph.png
Views:	1
Size:	26.2 KB
ID:	1066109

              Click image for larger version

Name:	Grounded.png
Views:	1
Size:	112.3 KB
ID:	1066110

              Click image for larger version

Name:	GroundedDirectional.png
Views:	1
Size:	172.9 KB
ID:	1066111

              Comment

              Working...
              X