can someone help me with Invalid call Nonexistent function is_action_just_presed in base inputDefaul

DanMakeGamesDanMakeGames Posts: 2Unconfirmed Member

can someone help me with this problemom?

Comments

  • MegalomaniakMegalomaniak Posts: 3,333Admin
    edited January 24

    You have to add those actions in the project settings. Or you could create them in code.


    This discussion was caught in the moderation queue since you have not confirmed your account yet.
    Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.
    If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:
  • TwistedTwiglegTwistedTwigleg Posts: 3,956Admin
    edited January 24

    I think it could also be the if statement in the return that could be causing the issue. I don't remember right off how ternary if statements work in Godot, but I remember they are kinda strange. If adding the actions in the project settings or through code do not fix the issue, I would see something like the code below works instead.

    func get_direction() -> Vector2:
        var y_pos = 1.0
        if Input.is_action_just_pressed("jump") and is_on_floor():
            y_pos = -1.0
    
        return Vector2(
            Input.get_action_strength("move_right") - Input.get_action_strength("move_left"),
            y_pos
        )
    
  • MegalomaniakMegalomaniak Posts: 3,333Admin

    I mean I recognize the code, it looks just like the code in the GDQuest third person controller template, and when I copied the files over into my own project I just needed to add all the actions via project settings for it to work.

  • dotteddotted Posts: 146Member

    is_action_just_pressed not is_action_just_presed.

  • MegalomaniakMegalomaniak Posts: 3,333Admin

    Ah yes, thats it. Don't you just hate it when you make a hard to identify typo... :blush:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file