generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Camera Rotates Around Part

Previous Thread :: Next Thread 
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:06 PM
When a player uses the mouse wheel, I want their camera to rotate around a part. My script is sloppy and the camera can only rotate between two different positions, instead of 360.

repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse()
local target = workspace.Customization.CameraArena
local camera = workspace.CurrentCamera
player = game.Players.LocalPlayer
mouse = player:GetMouse()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target


mouse.WheelBackward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, -1, 0)
* CFrame.new(0, 0, 15)
end)

mouse.WheelForward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, 1, 0)
* CFrame.new(0, 0, 15)
end)
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:08 PM
Any help would be appreciated. :)
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:10 PM
Bump
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:17 PM
Bump1
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
20 Dec 2015 06:18 PM
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse()
local target = workspace.Customization.CameraArena
local camera = workspace.CurrentCamera
player = game.Players.LocalPlayer
mouse = player:GetMouse()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target


mouse.WheelBackward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, -math.rad (1), 0)
* CFrame.new(0, 0, 15)
end)

mouse.WheelForward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (1), 0)
* CFrame.new(0, 0, 15)
end)
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:22 PM
Thanks for replying, Casualist. However, that doesn't work either. It's still only rotating between two positions.
Report Abuse
XIPokezIX is not online. XIPokezIX
Joined: 24 Sep 2015
Total Posts: 381
20 Dec 2015 06:24 PM
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse()
local target = workspace.Customization.CameraArena
local camera = workspace.CurrentCamera
player = game.Players.LocalPlayer
mouse = player:GetMouse()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target


mouse.WheelBackward:connect(function() camera.CoordinateFrame = cam.CoordinateFrame*CFrame.new(target.Position)
* CFrame.Angles(0, -math.rad (1), 0)
* CFrame.new(0, 0, 15)
end)

mouse.WheelForward:connect(function() camera.CoordinateFrame =cam.CoordinateFrame* CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (1), 0)
* CFrame.new(0, 0, 15)
end)
Report Abuse
101airsoft is not online. 101airsoft
Joined: 11 Mar 2012
Total Posts: 145
20 Dec 2015 06:25 PM
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse()
local target = workspace.Customization.CameraArena
local camera = workspace.CurrentCamera
player = game.Players.LocalPlayer
mouse = player:GetMouse()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target

local a=1 --angle

mouse.WheelBackward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, -math.rad (a), 0)
* CFrame.new(0, 0, 15)
a=a+1
end)

mouse.WheelForward:connect(function() camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (a), 0)
* CFrame.new(0, 0, 15)
a=a-1
end)
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:28 PM
That doesn't focus on the target.
Report Abuse
XIPokezIX is not online. XIPokezIX
Joined: 24 Sep 2015
Total Posts: 381
20 Dec 2015 06:29 PM
Which one
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:30 PM
@101 Moving the wheel forward now works, but moving it back resets the position.
Report Abuse
101airsoft is not online. 101airsoft
Joined: 11 Mar 2012
Total Posts: 145
20 Dec 2015 06:30 PM
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local target = workspace.Customization.CameraArena
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target

local a=1 --angle

camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (a), 0)
* CFrame.new(0, 0, 15)

mouse.WheelBackward:connect(function()
camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (a), 0)
* CFrame.new(0, 0, 15)
a=a+1
end)

mouse.WheelForward:connect(function()
camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0, math.rad (a), 0)
* CFrame.new(0, 0, 15)
a=a-1
end)
--That one should work better
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:30 PM
@X You left out the target.Position
Report Abuse
Ophic is not online. Ophic
Joined: 28 Dec 2013
Total Posts: 25
20 Dec 2015 06:31 PM
Ok, thanks 101! It works now!
Report Abuse
101airsoft is not online. 101airsoft
Joined: 11 Mar 2012
Total Posts: 145
20 Dec 2015 06:32 PM
No problem.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image