Skip to content

MAGGen-hub/Joystick-Godot-Inspector-Plugin

Repository files navigation

Joystick Inspector Plugin

Plugin for Godot Game Engine created to control Vector2 properties with virtual joystick-like control.


Works like default Godot int or float properties slider, but in two dimensions.
Can be used to smoothly adjust 2d values with your mouse in selected range.

To enable joystick for Vector2 property use next code:

@export_custom(PROPERTY_HINT_TYPE_STRING,"") #insert joystick config or leave empty
var basic_joystick:=Vector2(0,0)

Configuring joystick: Export hint_string can be used to configure joystick behaviour.

Configuration parameters:

  • grid:X - Controls type of joystick coordinate grid.
    X can be set basic and radial values. Default is basic.
  • limit:X - positive float value, specifies maximum value that can be set to
    Vector2 property with it's joystick. Default is 2.0, minimal is 0.002.
  • div:X - positive float value, specifies size of single cell in coordinate grid.
    Default is 1.0, minimal is 0.001.
  • keep_editor - boolean value, if set to true displays
    default Vector2 property editor under joystick control.

Additional feature: Holding SHIFT while using joystick will magnet output value to nearest grid axis or place where axises cross. Works with on both grid types, but especially usefull with radial one.
Makes things spiiinnnnn...

Usage Example

P.S. Project has built-in demo. Remove it with Godot asset downloader config, if you don't want it. Or delete demo folder manualy.

About

Godot plugin that adds joystick-like controls for selected Vector2 properties.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published