MarcoFazioRandom / Virtual-Joystick-Godot

A simple virtual joystick for touchscreens, for both 2D and 3D games, with useful options.
MIT License
742 stars 80 forks source link

Idea suggestion for second stage jostick drag outside of circle area #49

Closed trekfan42 closed 1 year ago

trekfan42 commented 1 year ago

Im working on a twin stick shooter and I was thinking about how to implement walking/ running switch and aiming shooting switch...

the idea is the the central joystick sticks to the bounds of the ring for the first level of control, ie. walking, but once you drag past a radius threshold, the joystick unsnaps from the rings bounds and then you enter a second stage ie, running.

The same for aiming, just pointing and holding up to a range of the circle's edge is just aiming but when you drag outside the threshold it unsnaps and now your shooting, all the while you can still keep moving and aiming in any direction. but if you drag back to center it goes back to the first stage or if you let go.

thoughts?

MarcoFazioRandom commented 1 year ago

Hello, I remember you already asked me this here #35 :) I think this could be a good idea for movement/shooting. As I said in the old issue, this plugin should stay simple and small to be easy to use and expandable, what you ask is a specific scenario that goes out of scope and should be implemented in your project.

maybe something like this:

@export_range(0, 1, 0.1) var running_threshold : float = 0.9
...
if joystick.output < running_threshold: 
    walk()
else: 
    run()
trekfan42 commented 1 year ago

Sorry didn't realize that was this project. thanks for the suggestion