Can you upload the project folder?
Godot Documentation Tutorial Error
There is a ^
in var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
The project would be helpful, if the above wasn't the issue.
Is the github link enough?
I can upload the folder but I won't be able to upload anything else for now
trizZzle
I will try removing the ^ when I'm able to, thanks
- Edited
game_enjoyer Is the github link enough?
Yes.
You didn't connect the timeout signals for the three Timers. They need to be connected to the corresponding functions in the main.gd script.
As the tutorial says:
Now connect the timeout() signal of each of the Timer nodes (StartTimer, ScoreTimer, and MobTimer) to the main script. StartTimer will start the other two timers. ScoreTimer will increment the score by 1.
After I connected the signals, the enemies appear.
trizZzle There is a ^ in var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
Actually, that's valid. I had to look it up in the documentation. The ^ makes the string a NodePath, which is the correct type of the argument of get_node(). It's not required, since NodePath has a constructor that converts a String to a NodePath.
Thanks so much, I was on the fence for switching to Unity.
Some of my favorite games are created in Unity.
I'll continue godot for now and see how it goes
DaveTheCoder trizZzle There is a ^ in var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
Actually, that's valid. I had to look it up in the documentation. The ^ makes the string a NodePath, which is the correct type of the argument of get_node(). It's not required, since NodePath has a constructor that converts a String to a NodePath.
Looked like a typo to me as it wasn't in the linked tutorial.
- Edited
my god, another issue I have is now when character dies, MobTimer does not stop and keep spawning mobs?
Edit: Nevermind, it seems my StartTimer has the autostart property on, after turning it off mobs stop spawning after character dies
- Edited
I ran into another issue..., I am really so frustrated
On this site: https://docs.godotengine.org/en/stable/getting_started/first_2d_game/06.heads_up_display.html
"In the Node tab, connect the HUD's start_game signal to the new_game() function of the Main node by clicking the "Pick" button in the "Connect a Signal" window and selecting the new_game()"
I am unable to connect to new_game, there is no option
I updated my github as well
EDIT: I NOTICED another solution which is to type new_game in the Filter Methods box, this will create a new_game function
Does this work as well?
- Edited
The problem is that the script HUD.gd is attached to both the Main node and the HUD node. That's why the functions in main.gd are not showing up in the connect dialog.
Right-click on the Main node, and attach the script main.gd.
I am finally done with this tutorial, I plan on testing myself and adding additional features to this game, but it won't be on this thread.
Thank you very much and everyone else who helped on this thread.
I just have 1 issue, I was tinkering with the source code for this game on github and ran into an error, its up to you if you want to help with this, i did not touch the mob script or tscn at all
The error is "Script inherits from native type Rigidbody2d so it cant be assigned to an object of type pathfollow2d
here is the folder for the project: https://github.com/claritybear/Original-dodge-the-creps
Script inherits from native type Rigidbody2d so it cant be assigned to an object of type pathfollow2d
This is literally the error. The script is attached to the wrong node type; i.e. the extends
part of the script needs to match the node type.
- Edited
Script inherits from native type 'RigidBody2D', so it can't be assigned to an object of type: 'PathFollow2D'
The script mob.gd is attached to the node Main/MobPath/MobSpawnLocation in the scene main.tscn. Detach it.