0 votes

There is a part in the player's code where I had to use get node on the player's sprite. So I wrote it like $Sprite, the sprite node itself is just called Sprite and it worked previously. But now it comes up with an error and says it can't find it. The sprite node is also a child of the player node.

I'm quite new to Godot and coding in general so I'm not sure if I'm missing something?

in Engine by (12 points)

Not really... at this point I'm still pretty sure your Sprite has been moved or has a typo in its name. I'd need to see the project.
Also judging by $Sprite.play("down"), it looks like your Sprite is actually an AnimatedSprite (but only the name should matter)

So how would I go about sharing the project with you? As I said I'm new to this

You can use file transfer: https://send.firefox.com/
Or Google Drive, or Github
Even though I believe your problem is probably something really simple

I tried opening it but all scripts are empty and Room.tscn does not open. Looks like it's not the whole project.
Wait...
You put scripts and assets in the .import folder? I strongly suggest you don't do this xD .import is reserved for cached import files. Godot has a problem loading Room.tscn for another reason, but because it is in .import, I can't fix it because the file explorer does not let me access it in the editor.

1 Answer

+2 votes

After having a look at your project, I saw what's going on:

You are getting an error about Sprite not being found because when the game runs, you have two player scripts.
One is inside the room, and does have a child Sprite, which is ok.
However you also have an autoload called Player with another instance of the Player.gd script on it. That node does not have a Sprite child, and that's where the error occurs. I suggest you remove this autoload because it's a duplicate of what you have in the scene already, and you are not using it anywhere.

Another important thing: you placed assets inside the .import/ folder. You should not do this. .import is reserved for cached import files, and is a folder that can normally be deleted safely and not included to version control (because it's all "temporary" cache files, really).
The save dialog allowed you to save files to it, but this is not really intented, probably should be raised as a bug.
Side effects of this are:

  • Assets in that folder cannot be accessed from the File Explorer. The scene magically loads when the project opens because it's the main one, but if you close it you can't reopen it again.
  • Searching in files from the script editor does not include this folder, because again, it's not supposed to contain your assets.
  • Quick-open also doesn't list these assets (Ctrl+Shift+O and Ctrl+Alt+O) for the same reason
  • Maybe more
by (27,900 points)

Thank you :)

hello im sina my project is grand theft auto iv physic version driving game i added ths spcrite

extends Node

var a = 0.0
var t = 0.01
func ready():
$Engine.play(0.01)
set
process(true)
func process(delta):
if Input.is
keypressed(KEYSPACE):
$spo.value = 1000
else:
$spo.value = 0
$Tween.interpolateproperty($HSlider2, "value",
$HSlider2.value, $HSlider.value, 0.1, Tween.TRANS
CUBIC, Tween.EASEINOUT)
$Tween.start()
if t < 0:
t = randrange(0.005, 0.02)
a = rand
range(0.1, 0.2)
$Engine_Ramp.seek(($HSlider2.value/1100)+a)
else:
t-=delta

info
spo means car engine sound hslider
and engine is audiostramplayer 3d i used truck town project for this
please help error is

E 0:00:14.769 get_node: Node not found: spo.
<C++ Error> Condition "!node" is true. Returned: __null
<C++ Source> scene/main/node.cpp:1381 @ get_node()
carsound.gd:11 @ _process()

help me plz plz!!!!!!!!!!!!!

and info gta iv car driving game comming soon if this problem solves new car game from godot think it my discord name is sina#3594
plz invite me to ur channel plz

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.