+1 vote

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 bulletinstance.setdirection(directiontomouse) because it has a little green arrow next to it(i don't know what that means)) but it could be something else. https://godotengine.org/qa/68630/how-to-disable-font-oversampling-warning
but the solution on there doent work for me

the line of code with the arrow https://cdn.discordapp.com/attachments/761966031945990167/781261865547464734/Capture.JPG

in Engine by (13 points)

My little brother is making games. And throughout the entire process of creating the game and it, a lot of mistakes and problems arose.

1 Answer

0 votes

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.

Here's some help : https://godotengine.org/qa/82268/how-do-i-correctly-implement-the-top-down-movement-i-want

Rewrinting your code with this should solve your problem.

by (66 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.