+1
Answered
Jarod Landaker 3 months ago • updated by Lazlo Bonin (Lead Developer) 2 weeks ago 6

Is this a bug or intentional?

It would be nice to be able to get the velocity of a body frozen in time for right when it resumes.


Thanks!

Chronos Version:
2.4.10
Unity Version:
5.6.1f1

* RigidbodyTimeline2D

Hey Jarod, 

Did you get a solution to this? I have just started experiencing the same thing today.

Thanks.

Under Review

Hi Jarod, Douglas,

I'm sorry for the extremely late reply. I've been very busy preparing the launch of our next plugin, Bolt

I'll try to find a moment this week to test & debug this. Just to make sure I understand correctly: as soon as you pause a rigidbody, its velocity becomes NaN? And when getting the velocity, you use GetComponent<Timeline>().rigidbody2d.velocitynot GetComponent<Rigidbody2D>().velocity, correct?

Cheers and thanks for the report,

Lazlo

Sorry for the delay!

So the timeScale going to 0 is done by an AreaClock, using LerpTimeScale. If I try to get the velocity of an object fully stopped therein, it returns NaN instead of its frozen velocity. 

Yes, I'm using its RigidbodyTimeline2D.

Probably why some of the projectiles caught in the AreaClock will just drop instead of continue their trajectory once they lerp back to timeScale = 1.


Hopefully that helps!

Sorry for the extremely late delay on this. Bolt has been taking up a crazy amount of my time!

I debated whether this was actually "by design" or not, but considering you can always act differently if you know the time scale is zero, you never need a NaN return; you could, however, want to know what the velocity was before the object was paused, which is usually why you use this property.

tl;dr: This will be fixed in v.2.4.11, which I'm pushing to the store today.

Apologies again for the delay.