- Home /
colliding fast moving objects? position in last frame
hi i read someplace on this website that it help to collide fast moving objects if you cast a ray from the position of the object this frame and the last frame. and if the ray hits something then move the object back to the position on the last frame. so i was wondering how to get the position of a object in the last frame.
thanks.
Answer by Mike 3 · Jul 14, 2010 at 03:16 PM
You can't - what you need to do is store the position yourself each frame
Check out the DontGoThroughThings script on the wiki, it does exactly what you want:
http://www.unifycommunity.com/wiki/index.php?title=DontGoThroughThings
Or, if that doesn't work, you can wait until Unity 3 comes out which has support for continuous collision detection for fast moving objects.
@Peter, this is from "the future"... I couldn't find such support on Unity 3. Could you point me to more info on this?
http://unity3d.com/support/documentation/Components/class-Rigidbody.html Continuous Collision Detection section