What is the best way to move NPCs using mouse clicks?

I want to make a basic mechanic in which the characters move to the place where the player clicked. (Like in The Conquerors 3 or another game)

I just want to know what is the best way to do this and I just need to get the mouse click position.

I just searched ‘move npc to mouse position’ and found a few posts about the same subject.

use NPC’s Humanoid:MoveTo function

like when client clicks, remote event fires to server and then server uses :MoveTo function to move the NPC to the position of the mouse

We can see he is referring to “The Conquerors 3” so that means his game will have a lot of moving NPCs at once which is very resource consuming when you use the standardised MoveTo function. In this case I would recommend just tweening or using CFrame

Ohh, yeah I didn’t see conquerors 3 before.

so I did see, and I think you should use raycasting, and get the surface position, then tween units to the position

Oh I thought this post was ignored as usual.

And I’ve already found a good way

You should post your actual solution so if someone is searching for an answer to the same question they can get help from your post. :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.