Does anyone know if either way is better than the other? I assume later on he’s going to put it into a separate function, but I guess he’ll probably keep the audio.isPlaying check. Mine doesn’t have that, but it doesn’t feel like it needs it. Could I be opening myself up to future bugs by not having that check, or is mine actually just a more direct way of doing this?
The former has the advantage of checking whether audio is already playing before trying to play it again which the latter lacks.
The name of the method in the latter is also a bit ambiguous, the name suggests it may process any sound but its in fact limited to the thrust.
Other than those observations, no real difference.
Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.
You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.