Help with Lasers Not Firing


Hi! I’m trying to get my lasers to fire with the ProcessFiring() method, using ActivateLasers(). I go into play mode and hit the space bar, the debug log displays, but no lasers display. Am I missing something?

Thanks for your help in the future!

Hi,

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.

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Maybe the problem is caused by the if-condition in Update. Test GetKey instead of GetKeyDown.

Hope this helps :slight_smile:


See also;

Hey Nina,

Thanks for your reply!

Understood on pasting the code in here, I’ll remember that next time :slight_smile:

I just compared my code to the lecture’s Github repository, and the issue was that I was using GetKeyDown instead of GetKey. That solved it!

Thanks for your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms