Hello,
I have a simple object that extends CharacterBody2D, and I'm trying to inspect the value of velocity.y in the debugger, where velocity is a member of CharacterBody2D. Is there an easy way to examine the value of velocity without printing it? I want to see it in the debugger.
Here is screen of the debug session , where can i see the velocity varibale ?
extends CharacterBody2D
class_name Bird
@export var gravity = 900.0
@export var jump_force = -300
var rotation_speed = 2
@onready var animation_player = $AnimationPlayer
var max_speed = 400
func _ready():
velocity = Vector2.ZERO
print("this is ready")
func _physics_process(delta):
if Input.is_action_just_pressed("jump"):
jump()
print("this is jump")
velocity.y += gravity+delta
#print(velocity.y)
velocity.y = min(velocity.y,max_speed)
move_and_collide(velocity*delta)
rotate_bird()
func jump():
velocity.y = jump_force
print(velocity.y)
rotation = deg_to_rad(-30)
func rotate_bird():
if velocity.y > 0 && rad_to_deg(rotation) < 90:
rotation += rotation_speed * deg_to_rad(1)
elif velocity.y < 0 && rad_to_deg(rotation) > -30:
rotation -= rotation_speed * deg_to_rad(1)