Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

can someone help with camera movement help?

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

2 answers

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.

2 comments

0

I want the camera to move left and right not turn right and left

0

Ah my bad my mistake. I didn't understand what you were asking.

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.

1 comment

0

It is already set to scriptable........ it is not moving in a circle is what i mean like i want it to do

This discussion is preserved as it was. New answers, comments, and votes are closed.