So I have this code to make it so an NPC follows the player, but I don’t want it to follow them too closely. I want some space between them so it’s not like they’re zombies. Is there a way to keep the rotation facing the player with this code and follow them while maintaining x amount in studs back from them? Thanks!
Thank you for your response. Unfortunately the topic you posted did not help as there were no formulas for an offset between the player and NPC. What I want is very simple- I want the same effect as
Just with an offset of x studs between the player and NPC in terms of space, but the rotation should be toward the player. Should I use LookVector for this? I know you can multiply CFrames in order to do this, but I don’t know how it works with Vectors, it doesn’t seem to work.
couldnt you just say humanoid:MoveTo(player.Character.HumanoidRootPart.Position) - 50 or something along those lines? I know the NPC wont be right behind the character but it should be able to give you some space
Like you advised guys, but it’s not a great solution because it only works when you’re facing one direction, but as soon as you change to the other direction the NPC will end up 5 studs beside you instead of behind you because the z and x planes don’t change so they’re either behind you or beside you depending on where you are according to the z plane. Thanks for your answers and the help.