#What am I doing wrong with this turn function?
34 messages · Page 1 of 1 (latest)
"Base object of type Nil" means your sprite hasn't been instantiated. Double check in the inspector that you've given it a value.
What value am I looking for? Is it the Flip H checkbox?
You're looking to set the value of the sprite itself. You need to click on your fish node, and set sprite to the sprite node
Both the player and enemy scenes have sprite notes with a corrisponding sprites assigned to them. I'm not sure what else is going wrong.
Can you show me your fish scene, as well as the inspector while you have the main fish node selected?
Main fish node? I don't have a node named that.
Well, whatever node you've given your fish script
I'm still confused on what you're asking here.
I have a fish scrpt, a EnemyFish script, and FishSpawner script, and a PlayerMovment script.
What's the fish script attached to?
Looking at it, It actually isn't attached to anything. It's in it's a script folder. I'm just following the tutorial I was going by.
Okay, show me your main scene
Is this what you mean?
Sorry for the late response btw. I got pulled away from my computer.
No worries.
Right click on the fish script and go to "View Owners"
Zero owners according to the popup.
Okay, now I'm starting to think I'm missing something...
What's the fish scene you got up there? You sure your fish script isn't attached to that?
The tutorial specifically said not to attatch it to any specific scene. To have it in a script folder for global scenes.
Okay, that node at the top that says "fish", click on that for me
Like this?
Yeah, like that.
Okay, so I don't know what's up with the tutorial, but your fish script is attached to your fish node. See in the inspector where it says sprite -> Assign? Click Assign, and then select the Sprite2D
Remember that @export var sprite: Sprite2D you wrote in the script? That's the variable that needed to be assigned.
Assign sprite where?
In the inspector to the right. Rewatch the portion of the tutorial on @export variables if you're feeling lost
I think timestamping where that export var got set up in the tutorial. They weren't very clear here for some reason. https://youtu.be/C8BRd_eDMIA?t=1923
Just a silly little starterproject I made thats similar in style to games like Fishy, Feeding Frenzy or even agar.io. Hopefully you can watch and learn something here, or otherwise use the project to make something new, its available for you to download and use however you wish! Links further down
Please forgive the repetetive background music ...
I'm seeing anything about the inspector here or what weas changed on it if at all.
Oh. I saw the assign part. I applied it to both the Player and enemy fish scenes. They're rotating perfectly now.
(Though now the numbers on the enemy fish stopped appearing for some reason.)
Well now I have a new problem.
Do I make a new topic for that or no?