Hello. I've been trying to understand how joints work in the engine, so I set myself a simple example:
var
Phys,Mesh, Phys2, Mesh2 : TEntity;
//////////TEST///////////
Phys := CreateBodyBox( 1,1,1 );
Mesh := CreateCube( Phys );
EntityType( Phys, 1 );
PositionEntity( Phys, mCar.GetPos + Vec3( 0,2,0 ), 1 ); //mCar is another entity
Phys2 := CreateBodyBox( 1,1,1 );
Mesh2 := CreateCube( Phys2 );
EntityType( Phys2, 1 );
PositionEntity( Phys2, mCar.GetPos + Vec3( 0,0.5,0 ), 1 );
SetBodyMass( Phys2, 1 );
CreateJointHinge( Phys, Phys2, mCar.GetPos + Vec3( 0,1,0 ), Vec3(1,0,0) );
Basically, I want to see how it works (just like in the wiki example), however when I run the above code, the second box (phys2/mesh2) falls to the ground, without hinge-ing or whatever. I even tried parenting before, but it makes it worse. What am I doing wrong? Thanks.