- Home /
Rigidbody.addForce() with a slow timescale
Hi everyone! I need to be able to throw some boxes at the player's position with addForce() from Rigidbody. It's ok, very easy, however I need to do this with a slow motion effect using TimeScale, but when I do this, looks like the AddForce is affected somehow by the timescale and the boxes almost does not move.. =(
Any advice?
Thanks in advance! =]
Answer by Muuskii · Oct 13, 2012 at 04:36 AM
From Time.timeScale:
If you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.
Also:
When timeScale is 1.0 the time is passing as fast as realtime. When timeScale is 0.5 the time is passing 2x slower than realtime.
So I'm not sure what @harschell thinks Time.timeScale = ( 0.5f * Time.deltaTime ); is going to do, but I think that it's going to set the Timescale to really super low.
At least based off what the documentation says. Could be wrong on that one.
Thank you all for the replies! Yes I´ve messed with "something * Time.deltaTime" but did not helped too much =/. What i could do is when going slow motion I increased the force for the AddForce, so the object could travel faster tha it would in normal conditions, so I could get an satisfatory speed.. if you guys want to check the result: www.ronaldosilva.com/SHARE/demo1.mp4
Thank you again!
I don't remember if I've posted this here yet (Thought I had) but it says in the documentation that multiplying a force magnitude by Time.DeltaTime is actually unnecessary.
That in itself might be your issue to be honest.
None of them. I just trigger an event and then I apply body.addForce to the boxes and stat my slow motion script..
Answer by harschell · Oct 13, 2012 at 04:27 AM
Try **`Time.timeScale = ( 0.5f Time.deltaTime );`*
Use appropriate value instead 0.5f