why is that this occurring😭 why is it null and cant discover animtree node in godot 4.2?

why is that this occurring😭 why is it null and cant discover animtree node in godot 4.2?

[ad_1]

why is that this occurring😭 why is it null and cant discover animtree node in godot 4.2? – Sport Improvement Stack Trade







Sport Improvement Stack Trade is a query and reply website for skilled and unbiased sport builders. It solely takes a minute to enroll.

Signal as much as be part of this neighborhood

Anyone can ask a query

Anyone can reply

The perfect solutions are voted up and rise to the highest

Requested

Considered
6 occasions

$begingroup$

extends CharacterBody2D


@export var SPEED = 300.0
@export var maxHP = 100
@export var curHP = 100

var gravity = ProjectSettings.get_setting("physics/2nd/default_gravity")
var state_machine = $AnimationTree.get("parameters/playback")

func _ready():
    move


func _physics_process(delta):
    if not is_on_floor():
        velocity.y += gravity * delta
    
    var course = Enter.get_axis("ui_left", "ui_right")
    if course:
        velocity.x = course * SPEED
    else:
        velocity.x = move_toward(velocity.x, 0, SPEED)
    
    if velocity.size() > 0:
        state_machine.journey("run")
    else:
        state_machine.journey("idle")
        
    
    if Enter.is_action_pressed("ui_left"):
        $Sprite2D.set("flip_h", true)
    if Enter.is_action_pressed("ui_right"):
        $Sprite2D.set("flip_h", false)
    
    
    move_and_slide()
    
    if Enter.is_action_just_pressed("assault"):
        _shoot()

func _losehp():
    curHP -= 10

func _die():
    if curHP == 0:
        move

func _shoot():
    if Enter.is_action_just_pressed("assault"):
        move

enter image description here

enter image description here

enter image description here

please assist:(

$endgroup$

You need to log in to reply this query.

Browse different questions tagged .

default

 

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Scroll to Top