I have some spheres that stay in the sky until gravity is enabled, when they fall down and roll around. Once gravity is enabled and they start to fall, I want to record their exact fall, so that I can play this animation back in reverse, in order to put them back in their original positions (on a button press - both reversed animation would play and gravity would be disabled).
I have looked at the gameObject recorder, however that seems like it is only used in the editor, for creating an animation. It is possible that the user might throw something at the spheres, so I think it would be important for me to record the actual animation in game.
What might be a good way to approach this problem? Thank you
For anyone interested, I ended up doing this very manually. When the objects fell, I saved all positions to a list, and then reversed that list, and played that reversed list back over a slowed down for loop (using WaitForSeconds).
This will work if you play the array backwards
For the future, here is a script that does that fine, it’s in JS i don’t know when they will bring it back to unity 2023 DD
it’s a short file so it should take 10 mins to rewrite to C#, and it’s reeeely minimalist so easy to understand.