Search code examples
mathluarobloxcoordinate-systems

How to make a simple pointTowards() function in Roblox lua


Specifically, I want to make a part point towards the players x, y, and z coordinates. Is there a math equation that I can use? Or maybe something along those lines?? Thank you


Solution

  • Try using:

    YourPart.CFrame = CFrame.lookAt(YourPart.Position, Player.Position)