|
| 14 Feb 2015 04:07 PM |
I have this thing that rotates a set amount of degrees every 1/60 of a second. The problem is I need to know how long it takes to rotate once
The degrees increase (every 1/60 of a second), is called rot
Can someone please help me? |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 04:09 PM |
local rot=0 print('It will approximately take about '..TIME..' To rotate once') game:GetService('RunService').RenderStepped:connect(function() rot=rot+1 end |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 04:10 PM |
SORRRY SORRY THE AMOUNT IT INCREASES IS CALLED INCREASE
local increase=1 local rot=0 print('It will approximately take about '..TIME..' To rotate once') game:GetService('RunService').RenderStepped:connect(function() rot=rot+increase= end
|
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 14 Feb 2015 04:22 PM |
In order to calculate this: you gotta have the increment of rotation, and the total rotation.
For instance, if I rotate a ball once every second, I couldn't tell you how long it would take without knowing when to stop rotating it and by how much to rotate it each second. |
|
|
| Report Abuse |
|
|
Sinblade
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 2782 |
|
| |
|
|
| 14 Feb 2015 04:24 PM |
Okay so think of it like im spining a circle.
Every 1/60 of a second I move it (increase) degrees, and the max degrees is 360, so how long until it gets to 360 |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 14 Feb 2015 04:25 PM |
| so then it's 360/60 * 1 or just simply 6 seconds |
|
|
| Report Abuse |
|
|
Sinblade
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 2782 |
|
| |
|
|
| 14 Feb 2015 04:27 PM |
I was looking for an equation, I kinda already figured that much out.
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 04:29 PM |
Its like doing
if your going THIS distance per 1/60, and you want to 100 distance, how long will it take in seconds to go that far? |
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 14 Feb 2015 04:35 PM |
if speed is distance over time, then time is distance * speed
so time = distance * degrees/60 I also think it has something to do with size
geez, these people are testing my math skills today. |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 04:37 PM |
| I tested mine and what I was doing works the way it should and if you replace increase with 1 it makes 6 so it works. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 14 Feb 2015 04:40 PM |
Simple.
Target/(IterationsPerSecond*StepsPerIteration) |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 04:41 PM |
| Why does mine work yet his make sense? |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
| |
|
| |
|