(Please Help) Police System

Hey I’m looking to make a gta type game and I don’t really understand how I would start making a police system for my game. I would like to have a police character who will go after the player if you commit a crime and shoot at you if the player attacks them. But for police cars I want it where they will chase the player if they commit a crime if they are in a car but if they are near them and they sit still in a car for too long or on foot they will get out of the police car and chase the player or shoot at them?

If this is your first game, I’d honestly scale it back a ton. Having a system like this would require a ton of work (depending on how close you’d want it to GTA) and it’ll involve so many different elements of gameplay systems.

If I were you, I’d start basic first and learn some things about AI first. Try to get an actor to chase the player when they come into line of sight. Then try to implement something that if the player interacts with a button (for example), the AI will start to chase the player. It’s a lot more complicated when you start to break things down.

Then look into things like State Machines, Behaviour Trees, etc. Then you’d need to think about what constitutes a crime in your game. Shooting an NPC? Super, then you’d need to think about how that sort of NPC would behave. Then you’d need to think about a weapons system, vehicle system, player controller, etc. the list goes on.

3 Likes

I would like to know how to do a gta5 type of system were they will just go to the player and start shooting at them like in gta5

You have a great answer above with all the bits that you need listed - look them up, tutorials for all of it already exist.

What i really want to know is how to make npc get in and out of cars

It’s all really out there:

https://www.youtube.com/results?search_query=ue4+ai+enter+car

1 Like