Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | kavivi |
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 Capture hosted at ImgBB — ImgBB
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
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.
SweetPie | 2022-10-21 03:27
Both nodes are KinematicBody2D nodes. Also Updated the picture link, thanks
kavivi | 2022-10-21 04:01
Could you also post all of the code involved with the player’s movement?
SweetPie | 2022-10-21 04:24