It is late for me right now, which is probably the reason, but I’m not totally sure what you mean by “squeeze and jump” in the air, nor what you mean by locking a button after a press.
If you do not mind, can you explain and/or give an example of what you are wanting to achieve? I’m sure I’m missing something.
As for double jumping in general, there are several ways to implement double jumping mechanics depending on your project.One way I’ve written double jumping in 2D side scrolling games is something like this (untested):
extends KinematicBody2D
# Define a class variable for tracking how many times the
# character has jumped
var jump_count = 0
# other variables
var velocity = Vector2(0, 0)
const JUMP_SPEED = -100
func _physics_process(delta):
if (is_on_floor() == true):
# When we are on the floor, reset the jump count
Jump_count = 2
# If the jump action is pressed...
if (Input.is_action_just_pressed(“ui_up”)):
# If there are jumps left in jump count...
if (jump_count > 0):
# Jump!
velocity.y = JUMP_SPEED * delta
# remove one from jump_count
jump_count -= 1
That is more or less how I’ve done double jumping in other projects. I can see if I can find the code that handles double jumping in one of the projects if you want. I think it is similar, though there might be some minor differences.
For 3D, the idea is generally the same, just how you detect whether the character is on the ground or not can be a little more complicated.
Hopefully this is of some help!
(Side note: Welcome to the forums)