This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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
in Engine by (45 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.