x


Applying Forces, independent of Frame Rate?

I'm having problems creating frame rate independent controls for my character, in this case a boat.

I am getting the in put in the Update() and then applying forces to the rigid body in the FixedUpdate.

I'm not sure to ether use Time.DeltaTime or Time.FixedDelta time?

What is the correct way to make the forces applied to the rigid body completely frame rate independent?

more ▼

asked Feb 03 '12 at 06:11 PM

ddeaco gravatar image

ddeaco
1 3 4 4

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

For framerate independence you want to use Time.deltaTime in Update() and Time.fixedDeltaTime in FixedUpdate(). It is recommended that you perform Physics operations in FixedUpdate().

more ▼

answered Feb 03 '12 at 06:35 PM

kevork gravatar image

kevork
415 1 2 4

I currently calulate a forward force and turning force based on how long a key is pressed in Update(). I also also reduce these values over time inside Update().

Should these values be multiyed by the deltaTime inside the Update() or by FixedDeltaTime inside FixedUpdate. Before they are applyed to the rigid Body inside FixedUpdate()?

Feb 03 '12 at 06:48 PM ddeaco
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1866
x1172
x494
x74
x22

asked: Feb 03 '12 at 06:11 PM

Seen: 808 times

Last Updated: Feb 03 '12 at 06:48 PM