Can't find direct path

I’m trying to make a horror game where one of the characters are supposed to haunt the player. I want it to randomly pick a position near the player and teleport the character there. The player must be able to see the character from its position. How would I achieve this?

Any help is appreciated :grinning:

using CFrame.
you cant know this if i :heart: this

I will use CFrame to move the character, but I need to know if there’s a direct line from the players head to the characters head.

yourzombiehumanoid:MoveTo(player.HumanoidRootPart.Position)

Try raycasting from the players head to the character head using their Positions. The raycast result will tell you if they can see eachother. I suggest you check Raycasting | Roblox Creator Documentation and WorldRoot | Roblox Creator Documentation.

1 Like