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: is there a formula to see changed angles in player?

Previous Thread :: Next Thread 
misgav11 is not online. misgav11
Joined: 21 Apr 2011
Total Posts: 3418
25 May 2014 07:35 PM
like if i turned 30 degrees left or right.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
25 May 2014 07:38 PM
Character.Torso.Rotation.
Report Abuse
AMasterProgrammer is not online. AMasterProgrammer
Joined: 02 Apr 2013
Total Posts: 1608
25 May 2014 07:44 PM
local lasty = 0
local Player = game.Players.LocalPlayer
local Char = Player.Character
local Torso = Char.Torso

local maxDiff = math.rad(20)

function turned(direction)
-- code
end

Torso.Changed:connect(
function()
local lv = Torso.CFrame.lookVector
local cy = -math.atan2(lv.x, -lv.z)
local diff = cy - lasty
if diff => maxDiff then
if diff > 0 then
turned("left")
else
turned("right")
end
end
end
)
Report Abuse
misgav11 is not online. misgav11
Joined: 21 Apr 2011
Total Posts: 3418
25 May 2014 07:54 PM
^it didnt work
Report Abuse
AMasterProgrammer is not online. AMasterProgrammer
Joined: 02 Apr 2013
Total Posts: 1608
25 May 2014 09:01 PM
if math.abs(diff) > maxDiff then *
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