Announcement

Collapse
No announcement yet.

Issue with bool variable setup in character blueprint

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

    Issue with bool variable setup in character blueprint

    Click image for larger version

Name:	camerashake.jpg
Views:	1
Size:	165.5 KB
ID:	1180663
    Click image for larger version

Name:	function1.jpg
Views:	1
Size:	192.3 KB
ID:	1180664

    Trying to setup a bool variable in the character blueprint that is true when the player is not moving. First screenshot is the character BP event graph, the second is the function bPlayerNotMoving.
    In the current setup is is always on, even if he is moving.

    #2
    You must watch this: https://www.youtube.com/watch?v=PZRI1IfStY0
    Really watch it, he talks about your problem (or causes of it).

    And only after you watched above video you should use this node: nearly equal

    Or simply put there if its less than 10 or so.

    Comment


      #3
      I don't think that is the problem. I have the same setup in a widget, calling the exact same function and it correctly displays the boolean depending on player speed. I would like to know if there is something wrong in the setup I have created.

      Comment


        #4
        Click image for larger version

Name:	shake3.jpg
Views:	1
Size:	228.7 KB
ID:	1104918

        Removed the function and put the complete sequence directly into the graph and it worked. Still I am wondering what went wrong in the first attempt.

        Comment


          #5
          You are setting the variable after each tick, but in reality it should be set only if the player does or does not move. This condition alone is the BOOLEAN that needs to be TRUE for the camera to shake. You don't need ta call a check every tick, since it is already asking the Boolean if it is true or not.
          http://www.frostfire.ee Game development & resources

          Comment


            #6
            I don't get what you mean. At some point the game has to check every tick whether the player is moving.

            Comment


              #7
              Add "Do once with reset" after branch in camera shake graph.
              If it starts shaking and never stop Xintoc was right.
              then you need to add some delay and reset do once gate.

              Comment


                #8
                Your node after your function needs to be a get, not a set.

                Comment


                  #9
                  What I mean is Imagine Event Tick as a burst of TICK TICK TICK TICK times infinity per second. Now before the camera shake could end, there comes another tick saying "Hey, start the shake animation again!"

                  Click image for larger version

Name:	shake.png
Views:	1
Size:	92.0 KB
ID:	1104926
                  Here it is set up so that When the player speed is not equal to "0" then event tick will play "MyShake" Camera shake Once and after the duration of the animation the event tick is allowed to play it once more.

                  There is probably a better method to loop the shake while holding down a certain input/key which would get rid of the Event Tick entirely.
                  http://www.frostfire.ee Game development & resources

                  Comment


                    #10
                    Thanks for the example, it is very useful.

                    Comment

                    Working...
                    X