Sorry for terrible question. here is my problem. I have a Node2d Node in my Main Scene.And i instanced a Sprite node using export PackedScene. Also there is an inputmap named startbalon using left mouse button.
I am trying to do this. When i press mouse button my instanced sprite node should exist first than scale up as long as i continue pressing left mouse button and when i release button it should go upwards scene. Basically i am doing a baloon.
My script does creates baloon instances in every button press and they scale up as long as i keep pressing the button but i am stuck on what todo for releasing and baloon goes upwards. Can you help me?
extends Node2D
export (PackedScene) var Balon
var position_balon
onready var balon
func _input(event):
if event is InputEventScreenTouch:
if event.pressed:
position_balon = event
balon = Balon.instance()
add_child(balon)
balon.position = position_balon.position
func _process(delta):
if Input.is_action_pressed("start_balon"):
balon.scale.x += 0.1 * delta
balon.scale.y += 0.1 * delta