Hello everyone, this is my first post here, so excuse me if i’m posting in the wrong place, and bear with me because its gonna be a long post, but i’m sure this will be useful for someone.
I’m been working on this backhoe simulator quite some time and I was doing all the movement of the backhoe using SetRelativeRotation for the arms and AddActorWorldOffset for the translation of the backhoe itself.
Doing in this way gave me a lot of control over the movement of the arms and the translation of the backhoe, but the sweep option in the SetRelativeRotation node its not implemented yet, so this gave a whole sort of troubles that I had to address and fix.
Here is one of the problems that I was having:
I manage to “fix” this overlapping by using the OnComponentBeginOverlap event to stop the movement if it hit the ground, but this gave me another problem:
This problem with the balls going through the shovel I wasn’t able to fix yet, because if I use the same method above the shovel will stop its movement if it touch any balls, and that’s not what I want
So, I went from a total different approach: using Physics Constraints. I watched some youtube videos (there are only a few) on how to use and setup the constraints and create and setup my entire backhoe blueprint, here is the screenshots from the setup:
After all the setup, I tried using AddTorque on the arm’s components to implement its movements, but the arms were all loosen, like ragdolls arms, and was impossible to have total control of the arms. I wanted them to be stiff in place and only move when I wanted. So, after almos 3 days of trying all sorts of things I managed to almost acomplish it…yes, almost
Here what I did: I disabled the gravity on all the components of my blueprint that belonged to the arm of the backhoe, I changed the center of mass of all the arm’s components to be exaclty where their physics constraints was.
On the physics constraints I did: configured the angular limits accordingly, enabled Angular Orientation Drive, with the Angular Orientation Target to (0, 0, 0) with the Angular Position Strenght according to their respective components (Very high values, by the way).
After all this, I managed to rotate my components by changing the Angular Orientation Target of the physics constraints in the Tick Event with the input from my joystick.
So, what I mean by “almost acomplish” is that the physics interactions are still a bit strange, kinda “jittery” and if I push to hard on a surface, sometimes the arms goes crazy or even go through objects. I kindly ask you guys if someone can help me with this, or can point me to the right directions, because I can’t even find related stuff online and there must be a way to do this efficiently.
Thank you in advance, and sorry if I made some english mistakes.