Say I created a small plane and wish the physics engine to spin it for me then come to a halt due to angularDrag. This works great.
Now, if I model a cylinder as a child of the rotating plane, it still works great.
But if I add a cylinder to the plane in the plane's Start function, the physics engine appears to get totally confused and will no longer spin the plane correctly.
Here are the steps to demonstrate this problem:
5) Drag RotatePlane script under Plane object in hierarchy
6) Select Main Camera - set Position (0,15,0), Rotation (90,0,0) so we can see the plane
8) Click Play - see rotating plane
Case 1: Modeled Cylinder attached to Plane
2) Drag the Cylinder under the Plane to parent it to the plane
3) Click Play - see rotating plane with cylinder - works great
Case 2: Dynamically-created Cylinder attached to Plane
1) Edit the RotatePlane script
2) Now click on Play and let run for a few seconds - the physics engine appears to get confused.
Any ideas what I'm doing wrong?
Those aren't the same thing...one, the manually created cylinder has a collider and the scripted cylinder doesn't, and they are scaled differently. Also, you shouldn't be adding a rigidbody to a mesh collider like the plane has; change it to a box collider instead.
answered Apr 27 '10 at 06:02 AM