Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AntBagel |
I’m making an horror game and I want to make a voiceline that only when the script will work. what should i do
this is the script, im stuck on it and idk what to do.
extends Node2D
var selected = false
func _ready():
pass
func _process(delta):
if selected:
followMouse()
var Points = 0
func followMouse():
position = get_global_mouse_position()
func _on_Area2D_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
if event.pressed:
selected = true
else:
selected = false