to preface: i’m sorry for my poor behavior that lead to my posts being wiped. i’ve changed and will not repeat
so i’ve been studying my friend’s code lately and saw that he scripted a simple zombie. you might have seen a post of his before asking the same question, but how do games make NPCs smoothly turn without constantly updating their position?
and yes, we did do the “set ownership to nil” for every NPC. the footage is laggy since OBS butchers my cpu.
It’s pretty easy, you should definitely utilize a module, and get some OOP systems going to create an NPC class. Give your NPC states, like “Attacking” and “Wandering”, this accounts for more realistic NPCs.
And lastly, use :Move(). It moves a humanoid in a direction, instead of :MoveTo(), which you have to call frequently, this might lead to some choppy behavior.
The NPCs in the video are probably calling :Move() at decent intervals, from observation I’d say 0.3 seconds. And you really shouldn’t have to call it more than that. Especially if you’re going to have A LOT of NPCs.
The last thing to do is implement path-finding, but that’s a whole other problem not relevant to this topic.
thanks for the advice, moveto: kind of sucks
could you give some code samples or like elaborate a little more, maybe link some docs, sorry i’m in a bit of a rush rn