Ive made a simple racing game that forces the player to sit in a chair. Very basic stuff, but i wanted to know how id make an enemy racer. The moment i make another player npc and force it into the chair, it wont do anything and idk how to tell it to do anything either. Is there a page on developer that im missing, or is there no way to make an npc perform custom actions, like with a keyboard?
NPCs in cases like this require more complicated coding that the DevForum can’t just provide you for free.
Keep in mind the following things:
- NPC’s code should not be what’s moving a car. Make the car have an NPC function or something.
- Enemy racers are very complicated and require lots of code on your part. You would have to know about AI neural networks or self-replicated
if
functions to perfect such NPC.
If only the pathfinder function wasnt limited to just humanoids
It’s not. It doesn’t require a humanoid if you use it properly.
I actually made these NPCs for my racing game. It is sort of complicated and I haven’t gotten mine perfect yet either. My Racer isn’t fast enough and he still get stuck now and then. I did this by writing a custom AI for my NPC that included controls for driving vehicles and methods for driving around the track, they could pick up boosters and use them just like regular players. The difficulty really depends on how smart you want your NPCs to be. The more you want them to do the more complicated it is.