Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity time deltatime

-- Simple Explanation for Time.deltaTime --

◉	Using Time.deltaTime Unity can tell us how long each frame took to execute

◉	When we multiply something by Time.deltaTime it makes our game
	"frame rate independent "

◉	The game behaves the same with slow and fast computers


Here a small Calculation for the big brainers

	◉◉ Slow PC ◉◉		◉◉ Fast Pc ◉◉

Fps:		10					100

Duration	 
of Frame	0.1s				0.01s

Distance
per Second	1 x 10 x 0.1 = 1		1 x 100 x 0.01 = 1

Both, slow and fast pc, move at the same rate. Without deltatime (duration of Frame)
the fast pc would be mooving much faster.

 
PREVIOUS NEXT
Tagged: #unity #time #deltatime
ADD COMMENT
Topic
Name
1+8 =