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: smooth camera rotation with mouse x & y pos?

Previous Thread :: Next Thread 
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
01 Nov 2016 08:33 PM
example

i.imgur
.
com
/jp2rOZB
.
gifv

i made this as an example, the code is a joke. what would be the best way about doing this? im bad at explaining things, so heres a picture if im not asking for too much here

i.imgur
.
com
/QiLSJbF
.
png

if someone can give me what i need to do this or an explanation, even a link to example code to do something like this it would be very helpful thx
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
01 Nov 2016 11:11 PM
bump
Report Abuse
RoyStanford is online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
01 Nov 2016 11:13 PM
Assign a var like rotation to 0, then whenever the mouse moves update that rotation var accordingly. So like:

local rotation
function deltaMouseMove(deltaX, deltaY)
local rotationInc = math.pi/64--change this for sensitivity
rotation = rotation + rotationInc
end

--//then in renderstepped
game:GetService("RunService").RenderStepped:connect(function()
cam.CoordinateFrame = CFrame.new(pos) * CFrame.new(0, rotation, 0)
end)
Report Abuse
RoyStanford is online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
01 Nov 2016 11:14 PM
Oops change this line:

rotation = rotation + rotationInc * deltaX
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
01 Nov 2016 11:17 PM
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local cam = workspace.CurrentCamera

mouse.Move:connect(function()
cam.CameraType = "Scriptable"
cam:Interpolate(CFrame.new(workspace.Part.Position),CFrame.new(mouse.hit.p.x,workspace.Part.Position,workspace.Part.Position)
end)

idk something like that don't judge me for my mess


Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
01 Nov 2016 11:24 PM
eh, i did this last time

function()
Camera.CoordinateFrame = CFrame.new(LoadingZoneCameraTarget.Position) * CFrame.Angles(0, 90 - (Mouse.X / 360), 0)
end

and was the result i had the gif, except the one in the gif was devided a lot more
Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
02 Nov 2016 10:37 AM
Bump, I'm curious too.

Instant Profit Finder: https://www.roblox.com/games/486614503/SFPF
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
02 Nov 2016 02:28 PM
anyone?
Report Abuse
ImperialOutcast is not online. ImperialOutcast
Joined: 24 Nov 2009
Total Posts: 12054
02 Nov 2016 02:31 PM
I made a similar script to this, give me like 5 minutes to find it.
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
02 Nov 2016 04:30 PM
bump
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
02 Nov 2016 06:37 PM
bump
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