Update: This is fixed because we control the laser from the PlayerController script. I would still like to know how to do this though. I thought my code should’ve worked.
I set mouseMove to true on the PlayerController script to toggle between using the keyboard and the mouse. When mouseMove is true the ship moves with the mouse. I want to do the same thing with the laser, so when I click the left mouse button the projectile appears/fires.
PlayerController script:
public bool mouse Move;
Laser script:
private PlayerController playerController;
if (playerController.mouseMove){
The error is: Object reference not set to an instance of an object.
