Hi, I'm new to Godot and have no other experience with coding;
can you please help a man out and tell me what's wrong with my coding?
I am unable to get the punching to work, and my player just stands there
extends KinematicBody2D
const UP = Vector2(0, -1)
const GRAVITY = 20
const JUMP_HEIGHT = -300
const SPEED = 300
var motion = Vector2()
var is_punching = false
func process(delta):
if Input.isactionpressed("uip"):
ispunching = true
$Sprite.play("punch1")
func _onSpriteanimationfinished():
is_punching = false
print(is_punching)
func physicsprocess(delta):
motion.y += GRAVITY
if Input.is_action_pressed("ui_right"):
motion.x = SPEED
$Sprite.flip_h = true
$Sprite.play("walk")
elif Input.is_action_pressed("ui_left"):
motion.x = -SPEED
$Sprite.flip_h = false
$Sprite.play("walk")
else:
motion.x = 0
$Sprite.play("Idle")
if is_on_floor():
if Input.is_action_just_pressed("ui_up"):
motion.y = JUMP_HEIGHT
else:
$Sprite.play("Jump")
motion = move_and_slide(motion, UP)