0 votes

So I want to make a AI aiming system and a gun system. I know how to record the player position. But the AI has guns so I want them to look at the player position to aim and shoot at them as well as follow them, how do I do that? I also want to make a gun shooting system how do I do that? Any good resources to help?

asked Mar 30 in Engine by Nothing (61 points)
edited Mar 31 by Nothing

2 Answers

+1 vote
Best answer

But the AI has guns so I want them to look at the player position

If you know the player position in global coordinates (and you say you do!), then you can use the look_at-function for that. Check out the documentation.

I also want to make a gun shooting system how do I do that?

There are a couple of plugins for that like this and this. If you want to implement a hit-scan weapon (i.e. a weapon that doesn't actually fire a projectile) I'd recommend this.

shoot at them as well as follow them, how do I do that?

Take a look at this tutorial on homing missiles. You might find his series on implementing a tank battle game helpful as well, especially parts 3, 4 and 5.

answered Apr 1 by njamster (8,992 points)
selected Apr 20 by Nothing
0 votes

My dear friend, in such a broad question, you should start with the basics first, GDquest, Kidscancode, Gamefromscratch, and many many other amazing creators have easy-to-follow videos for Godot that teach what you want. Google can help you find them, also, don't be scared of the docs for Godot, they are your best friend and took hours to cook.

If you have not, please start the ritual and become a chef for your games, your exquisite games.

enter image description here

https://docs.godotengine.org/en/stable/getting_started/step_by_step/scenes_and_nodes.html

answered Apr 1 by The_Black_Chess_King (265 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.