How do i make an NPC teleport behind the player if the player is not looking at it

That’s because he is anchored.

ah, okay

(textfillerrrrrrrrrrr)

can i use wait() to add a cooldown when he teleports?
if not, how can i add a cooldown, and how do i remove collision?

do you want the npc to go behind the player or do you want it to go through the player

behind the player, like in Identity Fraud.

NPC:PivotTo(Character:GetPivot() - Vector3.new(0, 0, 2))

try this

havent tested it because im on mobile right now

i had to swap the 0, 0, 2 to 5, 0, 0 and it works now.

nevermind, screwed something up, -5 worked

alright, though there might be problems when the player turns direction

0, 0, -5 should work, im going to try it

it always teleports to the side

i think

-Character.Humanoid.MoveDirection * 5

should work

now the end is red

do this

Stan:PivotTo(Character:GetPivot() - (-Character.Humanoid.MoveDirection * 5))

local CharacterPivot = PlayerCharacter:GetPivot()
NPC:PivotTo(CharacterPivot * CFrame.new(0, 0, 2.5))

This maniuplates the rotation matrix of the NPC so that the NPC is behind the character and looking at him.

this could mess up on turns though
i think
im not sure

How so?

\\\\\\\\\\\

works, but now he always spawns behind me, so i cant look at him.

But you asked to have him spawn specifically behind the character.

world space and object space things