I want the player to teleport to a certain area for an animated cutscene facing a certain direction.
However, this is not working, the player is facing a certain direction (the yellow arrow in the photo) instead of the red arrow (in the photo). I have used a decal to make sure what side is the front and have even multiplied the player’s CFrame to the angles of the part so I can align the player with the red arrow. Despite all my solutions I have tried and browsing from similar problems on the forum, I have been unable to finding an answer.
Here is the photo:
Here is the code that is on CLIENT (local script) to teleport the player):
character.HumanoidRootPart.CFrame = CFrame.new(115.896,39.01,758.959)*CFrame.Angles(math.rad(0),math.rad(-81.185),math.rad(0))
Note that (character) is the variable of game.Players.LocalPlayer.Character and that the code does teleport the player, but not in the way I want it to (aligning it).
ALSO, the player is ALWAYS in first person
Any help is appreciated, thank you for reading!
im confused, what is that part used for in the image and why is it not in the code provided below ?
It is the CFrame of the part, would it make more sense if the code looked like this?
character.HumanoidRootPart.CFrame = workspace.TrainCutscene_1.player_Tp_cutscene.CFrame*CFrame.Angles(math.rad(0),math.rad(-81.185),math.rad(0))
yes that makes much more sense. maybe try rotating the part now until it faces the desired direction
I’ve tried that, but it still always faces the same direction.
CFrame.new(Vector3.new(Part.Position.X, Part.Position.Y + character.Humanoid.HipHeight, Part.Position.Z), Part.CFrame.LookVector)
Thank you for the script. However, I believe it still doesn’t work. I get this in output:
Also the player still isn’t facing the right direction when I show this decal that shows the part is facing the direction I want.
Also, if this helps, this is the picture of what the player is facing at. This is a cutscene, I am changing the player’s camera to scriptable and assigning it to a part then tweening it. Because they are in first person, I assign the player’s head’s transparency to 0 to make it still visible, but when I teleport, it is facing this direction instead of what I want it to. Is the manipulation of the camera to the part the reason for this?