How do I change the default of a variable?

Godot Version 4

Question

var is_live := true
var line:MeshInstance3D
var velocity := Vector3.ZERO #changed
var past_is_on_floor := false
var v := Vector3.ZERO
var is_start := false

The “var velocity” displayed an error message.

If your using a characterbody, the error is because velocity is a defined variable of characterbody, you’ll just want to make a variable with a different name and set velocity to that variable

It wouldn’t hurt to then show what that error message is.

I guess they wanted to change the default value of “velocity”. The project was originally written in Godot 3. Is “velocity” a defined variable in Godot 3?

Ive been using gd 4 for quite a while, but looking at the documentation it looks like it is.