Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have an object that inherits from KActor that I would like to behave as a dynamic physics object, but I want its Z-Axis to remain upright, but very stiffly. I've tried the bStayUpright that triggers the "Stay Upright Spring". The problem is, it's a spring, and the object in question oscillates into position when I want it to remain oriented properly without wobbling.


In the image above, the yellow block has fallen onto the gray box, and it is currently pivoting about the contact point as it tries to right itself.

Should I be tweaking the StayUprightMaxTorque and StayUprightTorqueFactor parameters, or should I be using a Constraint of some sort?

share|improve this question
up vote 1 down vote accepted

So we decided we wanted the wall not to rotate at all, and here is the solution:

local QuadForceKCreateBlock MeshActor;
local RB_ConstraintActor AConstraint;

MeshActor = spawn(class'QuadForceKCreateBlock', none, 'PowerCreate_Block', BlockLocation(), m_PreparedRotation, , false);

AConstraint = Spawn(class'RB_ConstraintActorSpawnable', MeshActor, '', MeshActor.Location, rot(0,0,0));
AConstraint.ConstraintSetup.bSwingLimited = true;
AConstraint.ConstraintSetup.bTwistLimited = true;
AConstraint.ConstraintSetup.LinearYSetup.bLimited = 0;
AConstraint.ConstraintSetup.LinearYSetup.bLimited = 0;
AConstraint.ConstraintSetup.LinearZSetup.bLimited = 0;
AConstraint.InitConstraint(MeshActor, None);

The ConstraintSetup defaults to having TwistLimit and SwingLimit = 0, which will allow no rotation. It also defaults to TwistLimitSoft and SwingLimitSoft false, which guarantees you don't get any motion at all.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.