I am trying to make a mechanism where when the character move towards the direction of Jlamtt, the character gets slower the closer they get.
Hence, I am planning on loop getting the players’ distance and set their WalkSpeed depending on how near they are.
The Problem
At some point, the character’s WalkSpeed will reach 0 when getting too near to Jlamtt. The thing is, I want the character to be able to walk when facing the opposite direction of the Almighty Jlamtt. I would just have to set the WalkSpeed to 1 when the character’s torso is facing the opposite direction of Jlamtt, but I don’t know how to check if the character’s torso is facing the opposite of Almighty Jlamtt.
The Question How do you check if a character’s torso is facing the opposite direction of Jlamtt?
I would like to check if the character’s torso is facing the whole opposite axis of Jlamtt, not just facing the exact opposite of Jlamtt’s primary part.
To see which way the player is facing, you can use player.Character.UpperTorso.CFrame.LookVector
and to see which way a part is facing, you can do like the same thing: workspace.Part.CFrame.LookVector
So what you can do is store the player lookvector in a variable and type Variable = Variable - (Variable * 2) to just make the variable negative. Then you can subtract or add (idrk) the two look vectors.
I thought about LookVector, but I want for the character to face the whole opposite 180* of Jlamtt, basically facing the opposite axis. Nevertheless, I assume LookVector only works for specific face direction.
I believe using :Dot would help achieve this. With this you can tell if they are facing it. If you combine that with .Magnitude and some type of formula to do the walkspeed it should work.