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
Forummer
(Forummer)
March 15, 2022, 7:23pm
#2
-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
Bikereh
(green_lady)
March 15, 2022, 8:25pm
#4
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!!