so im doing ios development and im trying to make the camera twist and this is what i have and i dont know how twist it right.
input = game:GetService("UserInputService") cam = game.Workspace.CurrentCamera.CoordinateFrame input.TouchRotate:connect(function( touchPositions, rotation, velocity, state ) --script.Parent.state.Text = state game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(cam.x,cam.y,cam.z)*CFrame.Angles(-.5,rotation,0) end )
this doesnt work right because it twists up to the left and up to the right.
thanks! :D
Okay so soccer wasn't wrong. Twist is a very vague term, I'm not sure what you mean by it because twist defines all three axis. Do you mean roll? If so, do this for the angle.
cam:setRoll(angle)
That is the only way to set the roll of the camera.
Just like how an airplane tilts to the left or right; it is rolling in place but does not move.
If you want the camera to rotate (like I think you want it to), then you need to set the Camera.CameraType
property to Enum.CameraType.Scriptable
. The problem with this is it is harder to manipulate, but you have more freedom to do stuff like rotate it and whatnot.