I've been working on a space invaders like game on Unity 2d for the past month, and at this stage it is completely screwed up at least for me, bullets aren't coming from the enemy, attempts to make bullets fire on repeat aren't going through, a scoreboard which I tried to add has not been working properly, and despite constant attempts at fixing it, the problem are still persisting iโll post the scripts that are currently in my game
#my game has become screwed up
1 messages ยท Page 1 of 1 (latest)
Focus on one problem at a time
Posting code
๐ Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
๐ Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Links aren't working but I will try
iirc first 2 are down, try the last 2
is this some automatic code fixing tool? i was hoping someone would actually look at it themselves
it isn't, it's a site for you to post code so it's easier for us to read
so we can refer to line numbers, or use Find tools, etc
Understood
also as praetor mentioned, focus on one issue at a time. you know the overall picture of your code better than us - show the code that's relevant for one specific issue, once that's dealt with, go on to the next issue
that'll make it easier for us to help rather than posting a lot of code and a lot of issues at the same time
you were supposed to post links
did you press save like, in your browser lol?
to be clear, the point is to not send files
ok links got it
for that site, it's the "create paste" button
then you should have a unique link in your browser url bar
don't stress it, there's a first for everything lol
ok if this works, if i had to choose two scripts that are a main issue, you'll see the enemy bullet script and player damage script https://paste.myst.rs/eicqhloh
a powerful website for storing and sharing text and code snippets. completely free and open source.
I appreicate the support
right so which issue do you want to work on first
the enemy bullet script is a good start
right but what's the issue you want to start on
also i'm not seeing where the enemy fires?
i though i had included a video showing the game in action
Are you talking about the enemy bullet script?
i mean in the scripts, i shouldve specified
i'm only seeing 2 Instantiate calls, one for the player shooting, one for spawning enemies, so there doesn't seem to be anywhere the enemy actually shoots?
i did a ctrl+f through all of them
enemybullet would be for moving the bullet, wouldn't it? it wouldn't be responsible for spawning bullets
So are you saying I'm missing a script
well, if bullets are supposed to come from the enemies, then yeah
nothing's doing that
could just be part of Enemy, wouldn't necessarily need to be a separate script
Ok that's important to know
I should say that a majority of these scripts are automatically generated, something I realized early on could be problematic, tracking down the incorrections made to some of these scripts is a hassle.
yeah stay away from AI while learning lol. it's not going to help learning, you need experience that you don't yet have to actually properly use it as a tool (though personally i don't see the value)
While we are on the topic the script that supposedly would lead to my characters taking damage I assume is also incorrect.
the PlayerDamageTest/Enemy?
using tags can be a bit fragile (consider layers instead), but they seem about right. do they not work?
Unfortunely no