Hello everybody.
I am now trying for two days to get the following scenario working:
Imagine an excavator. He has a shovel attached to his arm. This shovel can swing under great influences of force, but also be rotated manually by the driver of the excavator (angular movement). I want this possibility in my C++ code.
Or maybe another example: A swinging door that closes itself. Once an object passed through the door and opened it, the door rotates back to resting state automatically.
Now my question: How do I implement this in C++?
I created a constraint that locks linear movement and enables limited swing. External force influences work so far, but I can’t make the constrained object move programmatically in a predictable and constant way.
I played around with the following code:
this->steerElement->getConstrainedComponent()->SetAngularVelocityDrive(true, true);
this->steerElement->getConstrainedComponent()->SetAngularDriveParams(50000, 100, 100000);
this->steerElement->getConstrainedComponent()->SetAngularVelocityTarget(rot.Vector() * 50);
But the constraint doesn’t move a single millimeter in any direction, I tried it with different values etc and I can guarantee that ‘rot’ is initialized. However, when I call to break the constraint, it works, so I am adressing the right constraint. But it isn’t reacting to any kind of motor. Or am I misunderstanding something? Unfortunaly there is absolutely no documentation about constraints in C++.
When I setup the same scenario in Blueprints, it works. (And no, moving to blueprints is not an option)
I would be really thankful if someone could help me out.