The velocity property is set to not be visible in the editor by default. You can change its editor status by overriding _get_property_list() for the node. The function needs to return an array of dictionaries with status of properties whose treatment you want to make different from default.

func _get_property_list():
	var properties = []
	
	properties.append({
		"name": "velocity",
		"type": TYPE_VECTOR2,
		"usage": PROPERTY_USAGE_EDITOR
	})

	return properties

Now the velocity will be visible in remote inspector.

  • umen replied to this.

    xyz
    Maybe is will work , but this is not good programming practice ,
    I just want to see it in the IDE

      Zini
      Yeah i I did read the documention , but it dosn't show any thing

      umen Maybe is will work , but this is not good programming practice ,
      I just want to see it in the IDE

      xyz's method solves the problem. Why is it not good programming practice?

      • umen replied to this.

        That's strange. I get all the properties displayed when I look at any of my objects, in stack variables and inspector.

        • umen replied to this.

          DaveTheCoder
          There is no language in the world that you need to do this stuff to view base class members if they public or protected or friend .
          And this is just the tip of why its bad

          • xyz replied to this.

            umen

            The same as you. You can see it in the lower-right corner.

            Now that I've created a new project with a CharacterBody2D though, I can't see the velocity either (unless I assign it to a variable). 🙁

            you can also make a var and export it, in your case as Vector2 *Edit: you don't need to export, just like duane said, you can achieve with a var

            umen There is no language in the world that you need to do this stuff to view base class members if they public or protected or friend .
            And this is just the tip of why its bad

            This has nothing to do with language. It is the editor issue, namely it's a matter of property display in the editor. Editor and language are two separate things. According to documentation, the code I posted is the proper way to change editor status of class properties. Appearance of custom properties can be controlled via @export but for properties inherited from built-in classes I think there's no other way except maybe creating shadow custom properties solely for purpose of tracking, which is imho much clumsier and bug prone than this.

            Inside a Script, _get_property_list may be overridden to customize properties in several ways. This allows them to be available to the editor, display as lists of options, sub-divide into groups, save on disk, etc. Scripting languages offer easier ways to customize properties, such as with the @GDScript.@export annotation.

            I'm not sure why they chose velocity to be invisible by default though. Maybe it's an oversight because this property was added in v 4. If you think this is the case - report the issue on Godot's github.

            Btw GDScript, similarly to Python has no concepts of public, protected or friend members/classes. Everything is public, although, again, member publicity and editor visibility have nothing to do with each other.