–5 votes

how can i change the "var change=0" code,
i want change=1
with remote script, change.gd


in Engine by (51 points)

you need to call the node itself.... you cant just write the name of the script and expect it to work...
for example if the node holding script.gd is named "bob" you will need to write $bob.change = 1

3 Answers

0 votes

In change.gd use single "=", like this:

script.change = 1
by (2,264 points)

you did not understand me

0 votes

enter image description here

by (51 points)

do you have a sample project

0 votes

in change.gd

 extends Node2D
    onready var script = get_node("NodeWith-script.gd")

    func _ready():
        script.change = 2

or using singleton.

by (154 points)
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 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 webmaster@godotengine.org with your username.