Player doesnt face object on touch

for my combat script when the player gets punched id like them to face the direction of the player that attacked them. I tried to use this line of code:

hitHRP.CFrame = CFrame.new(hitHRP.Position, -HRP.CFrame.LookVector)

but for some reason it doesnt work?

ive done this before in previous combat systems and im not sure what the issue is. Help is greatlty appriciated

EDIT: I also tried using CFrame.LookAt and it didnt work :sweat_smile:

-HRP.CFrame.LookVector

Remove the negative.

It’s also CFrame.lookAt() not CFrame.LookAt().

1 Like

i tried that awhile ago, and it didnt seem to change much. I want the players to face each other thats why i added the negative

This might work:

local posHRP = HRP.Position
hitHRP.CFrame = CFrame.new(hitHRP.Position, Vector3.new(posHRP.X, hitHRP.Position.Y, posHRP.Z))

Let me know if it does.

1 Like

this worked! thank you so much!!