#how to make a character look in the direction of a Vector3

1 messages · Page 1 of 1 (latest)

slate agate
#

im trying to make the player look in the direction of a raycast result, but i tried to use CFrame.lookAt() but it didnt work cuz the raycast result is a Vector3 so is there any other way i could do this?

lapis tartan
#

CFrame.Angles() maybe

fiery dagger
#

CFrame.lookAt(rayResult.CFrame) or sum idk how lookat works

dim valve
dim valve
fiery dagger
dim valve
#

dont pass cfram's, it wants vector 3 positions

#

like .position

fiery dagger
#

oh

dim valve
#
CFrame.lookAt(hrp.Position, Vector3.new(hit.X, hrp.Position.Y, hit.Z))```
#

im assuming he wants yaw only

#

for what he is asking

#

but as u can see

slate agate
#

oh is it the thihg the raycast hit

dim valve
#

Yes

soft gustBOT
#

studio** You are now Level 3! **studio

dim valve
#

Kind of obv lol

slate agate
coarse shard
slate agate
#

wait does lookalong work for an entire character or is it just for parts

slate agate
#

ok i figured it out, time to explain

#

here is the code for anyone else who wants to do this:

#

RootPart.CFrame = CFrame.lookAlong(RootPart.Position, rayresult.Normal * -1)