MarcoFazioRandom/Virtual-Joystick-Godot
MarcoFazioRandom/Virtual-Joystick-Godot has 991 GitHub stars and 98 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-21 22:30 UTC. Last push 2025-01-19.
What you can do
- Easy to integrate
- Customizable appearance
- Multiple joystick modes
- Input action support
측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
A simple virtual joystick for touchscreens, for both 2D and 3D games, with useful options.
창작 및 미디어README.md
OriginalGodot Virtual Joystick
A simple yet powerful virtual joystick for touchscreens in Godot, packed with useful options to enhance your game's mobile experience.
🎮 Features
- Easy to integrate
- Customizable appearance
- Multiple joystick modes
- Input action support
- Visibility options
📸 Preview
🚀 Quick Start
- Add the joystick to your scene
- Configure the options
- Use the following script to get started:
extends Sprite2D
@export var speed : float = 100
@export var joystick_left : VirtualJoystick
@export var joystick_right : VirtualJoystick
var move_vector := Vector2.ZERO
func _process(delta: float) -> void:
# Movement using Input functions:
move_vector = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
position += move_vector * speed * delta
# Rotation:
if joystick_right and joystick_right.is_pressed:
rotation = joystick_right.output.angle()
⚙️ Options
| Option | Description |
|---|---|
| Joystick Mode | Fixed, Dynamic, or Following |
| Dead Zone Size | Minimum distance for output |
| Clamp Zone Size | Maximum distance for output |
| Visibility Mode | Always, Touchscreen Only, or When Touched |
| Use Input Actions | Trigger input actions defined in Project Settings |
🛠 Setup Tips
- Create a
CanvasLayernode named "UI" for all UI elements - Add the Joystick scene as a child of the UI node
- Enable "Editable Children" to customize joystick appearance
- Refer to the example scene in the "Test" folder
📘 FAQ
Multitouch Issues?
Ensure these settings in Project -> Project Settings -> General -> Input Devices:
- "Emulate Touch from Mouse" : ON
- "Emulate Mouse from Touch" : OFF
If other buttons don't work with this configuration, use TouchScreenButton instead of TextureButton.
Input.get_vector() Not Working?
⚠️ Fixed in Godot 4.2.1
For earlier versions, use this workaround:
input_vector := Vector2.ZERO
input_vector.x = Input.get_axis("ui_left", "ui_right")
input_vector.y = Input.get_axis("ui_up", "ui_down")
Freeze/crash on Android editor
As mentioned in the Docs, the Android editor is still unstable.
🤝 Contributing
Contributions are welcome! Feel free to submit issues or pull requests on the GitHub repository.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the Godot community
관련 프로젝트 살펴보기
불러오는 중…