I set up a Node2D with a CharacterBody2D as a child of it. In the script, I have an export var for characterbody2d that I assign in the inspect. However using move_and_slide() doesn't work with this set up even though I can print all the data at runtime so it seems to be maintaining the reference.

here is the pseudo code:
`extends Node2D
var pos: Vector2 = Vector2.ZERO
var direction: Vector2
const SPEED: int = 750
@export var playerCharacterBody2D: CharacterBody2D
Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
Called every frame. 'delta' is the elapsed time since the previous frame.
func process(delta):
_moveCharacter()
#moves character
func _moveCharacter():
direction = Input.get_vector("move_left","move_right","move_up","move_down")
playerCharacterBody2D.velocity = direction * SPEED
playerCharacterBody2D.move_and_slide()`