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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Problem with detecting degrees of rotation in camera.

Previous Thread :: Next Thread 
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
09 Oct 2017 02:35 PM
I'm trying to find out how to find each degree of rotation a camera is looking at while turning left or right. I used a method where you start and 0,0 and you subtract that value with delta.x That way you get a 360* rotation. However, say my camera faces directly at a target and it's at 0,0. When I do a full rotation of my camera and land back on the target, I'm no longer on 0,0 but some other random number like -22, 0. This script is how I detect the degrees of rotation. TargetAngleX = 0,0 TargetAngleY = 0,0 Sensitivity = 0.1 ########## = 0.05 input.InputChanged:connect(function(inputObject) local delta = Vector2.new(inputObject.Delta.x/Sensitivity,inputObject.Delta.y/Sensitivity) * ########## local X = TargetAngleX - delta.y TargetAngleX = (X >= 80 and 80) or (X <= -80 and -80) or X TargetAngleY = (TargetAngleY - delta.x) %360 end)
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