how to make simpel swipe trail

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By agung

signal swipe
var swipe_start = null
var minimum_drag = 100

func _unhandled_input(event):
if event.is_action_pressed(“click”):
swipe_start = get_global_mouse_position()
if event.is_action_released(“click”):
_calculate_swipe(get_global_mouse_position())
func _calculate_swipe(swipe_end):
if swipe_start == null:
return
var swipe = swipe_end - swipe_start
emit_signal(“swipe”, swipe)

You asked what you want in the question title, but an image or animation of the desired effect maybe more helpful.

And tell everyone what is happening as a result of your code and why you think it is not working.

Also, tags are lie keywords or subject. Something like “mouse-position” or “draw-on-screen”.

Saitodepaula | 2019-12-05 13:48