- Home /
The power of the Force
This is a follow up question from my previous post
Like the post said I am having an issue with my 3d block when it touches the surface of the table. I want my 3d block to behave with real world physics when I rotate it along a flat, sturdy surface and not go through the table when I start rotating it. I want to know if I need to use the Force formula or is there any other formulaI need to add? Also, to which game object do I attach this script to: the cube, the table or both?
Thank you so much in advance.
what are you using to rotate your cube? rigidbody.$$anonymous$$oveRotation?
I just come to make a small test scene and everything seems to work for me. The small cube didnt go through the bigger one.
I used a big cube as a table, had a box collider on it. The 3d block was a cube with a box collider and a rigidbody. And I used a really simple script to test (just changing the rot in the inspector) :
public Vector3 rot;
void FixedUpdate() {
this.rigidbody.$$anonymous$$oveRotation(Quaternion.Euler(rigidbody.rotation.eulerAngles+rot));
}
are u using mesh collider? they tend to behave weirdly... If thats the case try checking the Convex checkbox
Don't forget to take Time.deltaTime in account, since you want the force thats being added to be framerate-independant. Greets