These days, I’ve been working on a build mode system, and I’ve implemented a camera system that moves using hotkeys. It works flawlessly till. I discovered the most serious error that affects the player: the character does not move in the correct direction. For example, if I press the “W” key, the player walks to the left or backwards, and the same is true for all other keys. (WASD)
My camera script modifies the CameraSubject, and if you’re curious, you can simply set the CameraMode to scriptable and it should work, right? No, my part gets stuck and it doesn’t move , and when the player presses the exit button, the camera subject goes back to its humanoid.
Here’s my script that changes the CameraSubject to the part:
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
cam.CameraSubject = plot.BuildCam
controlCam(plot.BuildCam)
And here’s the script that changes it back to the humanoid:
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
cam.CameraSubject = player.Character.Humanoid
Here’s an example of what happens when I hit exit (Which changes the camera subject to the Humanoid)
save the camera cframe before doing anything then set it back to the variable after you are done like so
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
local original = cam.CFrame
cam.CameraSubject = plot.BuildCam
controlCam(plot.BuildCam)
cam.CameraSubject = player.Character.Humanoid
cam.CFrame = original
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
local original = cam.CFrame
local offeset = vector3.new(0,0,-10) -- you would have to tweak this
cam.CFrame = plot.BuildCam.CFrame * CFrame.new(offset) -- assuming the part front is facing the plot
controlCam(plot.BuildCam)
forget about changing the camera subject entirely and see if that fixes it
This is quite bizarre in my opinion because everything should be working properly. Does the player’s HumanoidRootPart ever rotate 90-ish degrees in your scripts that’s somehow making the player’s character move weird like that?
I’m sorry @msix29 and @Dev_Breezy for spending your time trying to help me fix this silly error I made from this outdated script. The system is now excellent.
@MinionAlex4 Thanks for reminding me about that. Your post is the solution.