- Home /
setting transform physics2d issue
Hi,
I faced a strange 2D physics behavior when setting object's transform. This code influence physics simulation for some reason:
go.transform.position = go.transform.position;
The objects go down when doing this. Here's an illustration of what I mean. When I hit a key, the code above is applied to all boxes on the screen. You can see on the video few little sags when hitting the key once, and a huge sag at the end when I hold the key. The same happens when setting eulerAngles for all objects, even if eulerAngles are the same:
go.transform.eulerAngles = go.transform.eulerAngles;
Does anyone know how to avoid this?
Comment
Hi, could this thread be helpful perhaps with explaining how using transform.position affects your rigid bodies? http://gamedev.stackexchange.com/questions/69579/how-to-move-rigidbodies