How to I make an NPC with Luanoid move to another part (while facing that part)

Experimenting with Luanoids
Still can’t figure out how I can make them move to a certain position

Edit: I didn’t realize that the title’s grammar is broken

1 Like

Inside of src/client/init.client.lua you’ll find the local script source that requests the creation of and steps the simulation of the Luanoid. Since this is an NPC running on the server, this will have to be moved into a server script. To enable movement to a point you can either use the currently defined movementX and movementY fields in the input structure (just change them to the direction to move to get to a point instead of changing them when the keys are pressed), or you can add a field calling something like movementPos If you add movementPos then you’ll need to change the Walking state to handle a movementPos field by changing the walking velocity appropriately. If you feel like you implementation is good enough, submit a pull request to the github repo and perhaps other people will use it and thank you! I’ll probably use it at some point.

It’s the direction it faces and walks to that’s the issue for me, I’ve already moved it to be server compatible
I don’t know how to work my way around it with just single vector numbers (that’s usually required for the rotation)