Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a Point towards cursor script?

Asked by 4 years ago

I am making a Top Down View Game and I am wondering how I make my player point their whole body towards their cursor.

1 answer

Log in to vote
0
Answered by 4 years ago

Start off by creating a loop. Inside of that loop, we'll start off by placing the playƩr mouse.Hit.p value inside of a new variable MP. Then, we set the CFrame of the character's humanoidrootpart to CFrame.new(HumanoidRootPart Position, MP)

The MP variable is the player's 3D mouse position, and the CFrame.new() creates a new CFrame using 2 Vector3 arguments: The first is the position of the CFrame, and the second is where it points towards.

Ad

Answer this question