Announcement

Collapse
No announcement yet.

Stop Movement when player local rotation is NOT between 170* to 190* or -170* to -190*? node?

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

    Stop Movement when player local rotation is NOT between 170* to 190* or -170* to -190*? node?

    Hey everyone, I am working on a 2.5D skateboarding game.
    The player moves along the y axis, & can "ollie" (jump) over objects, and rotate locally on Z axis when in air.
    Problem is even if the player lands sideways(not 180* or -180*), he can still move.
    How do i go about constraining the movement to when the players local rotation is NOT 180* or -180* any other rotation would cause the player to stop, and ignore movement inputs until rotation is aligned 180*. Does a node exist that gets the rotation of the character, say between 170 and 190 can move?
    I appreciate your time, any ideas no matter how simple or small will help. Just ask for extra info if needed
    Thankyou

    #2
    EDIT:

    Here is a solution. modified from below post






    Orignal post
    This might be the wrong answer haha, but from recent playing around...

    there is a enable input option within blueprint, you might be able to setup a per tick check of y axis and if it is outside of said range it sets input based on a bool?


    Here was my thought process. i would say add this to event tick? so its checked every tick? (Fixed Image)




    EDIT:

    Worked exactly as intended!!





    every frame it checks if the player is faceing with in +/- 5% of straight, you can make it more strict, then im sure the "disable input" would run a get straight / look forward animation then re-enable input?
    Last edited by Duwayne; 08-29-2015, 05:09 PM.

    Comment


      #3
      The only problem I see with this is that if input is enabled, it may be possible that you are continuously enabling input. You may want to check to see if input isn't enabled before trying to enable it. It might not have to much of an effect on performance or anything, but I personally try not to let things like that happen.

      Comment


        #4
        I completely agree with _cDub for game implementation, i would go something like this for easy long term control / non clutter


        It only enables / disables input if it is already disabled/enabled. so the enable / disable input isn't spammed.

        Last edited by Duwayne; 08-29-2015, 05:00 PM.

        Comment

        Working...
        X