Hello, I’m trying to make it where if you press C your camera switches to a BackView of your character, I made it where it zooms out with a Vector but it is facing the torso, how do I rotate the vector to face the other way?
You will need to use CFrames in that case, it’s a lot simpler.
You can use this code and edit the degree value:
camera.CFrame *= CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) -- You'll need to play around with values to your liking
i got no idea how this works, could u help me make it like this but rotated the other way
Humanoid.CameraOffset = Vector3.new(0, -1, 0.59)
To make a vector face exactly the opposite direction just multiple it by -1.
Example with a 2D vector:
Multiplying the blue vector by -1 makes the red vector, which goes in the opposite direction with the same magnitude.
when one do i do -1 to? i did it to each and it doesnt change
Humanoid.CameraOffset = Vector3.new(0, -1, 0.59)
how would i flip this one
I believe that’s because the Custom CameraType’s position isn’t based on the Humanoid’s CameraOffset.
Humanoid.CameraOffset = Vector3.new(0, -1, 0.59)
Humanoid.CameraOffset = Humanoid.CameraOffset * -1
script is this
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(input, process)
if input.KeyCode == Enum.KeyCode.C then
Humanoid.CameraOffset = Vector3.new(0, -1, 0.59)
end
end)
The camera’s direction isn’t based on it’s offset.
i dont know much about vector and Camera offset, could u help me?
To be honest, I think you’d need to make your own camera code with Camera.Camera type and set it to CameraType.Scriptable. I’m doing some research though.
Edit:
I think the best way is to fork the default camera scripts. I’ll see if I can do that right now.
Forked PlayerModule with C to flip camera.rbxm (124.3 KB)
Here’s that code. Insert the roblox model into the game and put it into StarterPlayerScripts (StarterPlayer > StarterPlayerScripts). When you press C the camera should flip:
could u send it as a model? it doesnt let me download it