Topic was automatically imported from the old Question2Answer platform.
Asked By
Billiam
I am trying to make this top down shooter. and i keep getting this error that completely crashes the game (The line of code i think the error is coming from is bullet_instance.set_direction(direction_to_mouse) because it has a little green arrow next to it(i don’t know what that means)) but it could be something else. https://forum.godotengine.org/68630/how-to-disable-font-oversampling-warning
but the solution on there doent work for me
If I understood correctly, your variable direction_to_mouseis used to get the direction where the gun is aiming. If so, you should instead use the pre-built look_at() function that does all the job for you.
Rewrinting your code with this should solve your problem.
What if that is already in the script? I tried to look for a reason why it was acting like this and it said: Invalid call. Nonexistant function ‘set_direction’ in base ‘Area2D’
Chidiisanerd | 2023-02-13 12:58
What if that is already in the script? I tried to look for a reason why it was acting like this and it said: Invalid call. Nonexistant function ‘set_direction’ in base ‘Area2D’