Ingames player NPC's?


#1

Ok so I would love to add npcs to my game what would be the easiest way to do so use x&y to do the movement or would I have to use a javascript library?
Btw I have been looking at this project:https://playcanvas.com/project/338412/overview/1343-ad
but its really old It may have soome npcs


#2

look at this https://playcanvas.com/project/352037/overview/kallen-supremacy


#3

Lol you may not believe this but Ilooked at tht project the exact same day I made this post it lowkey made no sense


#4

Well npcs are placed at fixed places, enemies have random movements untill the player enter a certain radius, then they chase him. You can check the this https://playcanvas.com/editor/code/352037/Shop.js altough there are some garbage lines left. Since it’s multilanguage the phrases are strings that change based on the chosen language.


#5

Hmm thts alot of coding lol so is it like some kind of ai.Btw think you can show the project to this script


#6

Uh project to the script? What u mean? I already gave u the link to the project


#7

The link to the games project not the code editor


#8

Project link: https://playcanvas.com/editor/project/352037


#9

You can access the project using the code editor. Just go to the code editor tabs above and click, “Open Editor”.

Example:
image


#10

Thanks @yaustar.


#11

Sadly the scripts are in legacy lol


#12

With few adjustment will work, or u have to wait till i translate all to new scripts :stuck_out_tongue:


#13

I guess lol