0 votes

I have a player and a mob node. When the player stands on the mob, if the mob's pacing logic tells it to turn, the player is launched into the air as they turn. At first, I thought it was due to the player getting caught between collision shapes, but after changing the shape to be one shape, it still happened. When the mob turns, I am inverting the x scale to flip the hitboxes with the mob. Could this cause something to happen if the player is standing on top of the mob that causes it to be launched in the air?

Picture of Scenario https://ibb.co/dmdkvLT

This is the player logic for gravity and a double jump action:

if is_on_floor():
    usedflap = false
    if Input.is_action_just_pressed("jump"):
        velocity.y = -JUMPFORCE
else: 
    if usedflap == false and Input.is_action_just_pressed("jump"):
        velocity.y = -JUMPFORCE
        usedflap = true
    velocity.y += GRAVITY
Godot version v3.5.1
in Engine by (12 points)
edited by

Which kind of node are the player and the mob? Also, the picture doesn't work. You should post it on imgur and link it here.

Both nodes are KinematicBody2D nodes. Also Updated the picture link, thanks

Could you also post all of the code involved with the player's movement?

1 Answer

0 votes

If you are including collisionShapes used for body collisions (standing on player, standing on floor) that are used by the physics engine in the x.scale flip, that's probably the cause. Try only including hitboxes/hurtboxes in the x.scale flip and not touching the scale of the body box collision shape

by (570 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.