Ai bots for cocos creator 3d

Hi, anyone tried to create a bot for a shooting game? Please help to begin this work. thank you :slight_smile:


I’ve just recently created a 3D enemy for my game you can check out here:

What I’ve done is create a node and put my model of the enemy in that node. I’ve then created another node called waypoints under the main node. I’ve then made some more nodes in waypoints called waypoint1, waypoint2 etc. I’ve attached my script to the main mode. I then make the model lookat() the node by randomly selecting which node to look at. Then impulse the model forward. When the model becomes a certain distance from the node I then look at the next node and impulse forwards. I’ve put a pause in. When the character becomes a certain distance the enemy will lookat the character and impulse forward. When the distance becomes too big the enemy goes back to the waypoint cycle.

This is a pretty simple way of doing it, if you want to make it more percise a* pathfinding is what to look into. I did see a tutorial for that on the forums.

Hope this helps.

That’s really nice. Please explain to me how you implement that.

You can refer to this framework, there is an integrated behavior tree for making ai :

Thanks, I will check.

I checked the project and it’s not running with a missing script error. It’s showing.