I created an actor, added two cubes to it, and a physical constraint. I set the linear damping for both cubes to 0. I moved one of the cubes above the other and set it to simulate physics and disabled gravity. I also set the mass to 100 for both cubes. The physical constraint linked the bottom and top cubes together. I set the angular limits and the x, and y limits to locked. The z axis I set to free. I applied a linear motor to the z axis and left the default strength.
With these parameters when I move the cube on top the cube does osculate. However, the amplitude of osculation decreases over time. I can not find properties that might cause this damping effect that I haven’t already changed.
If someone could tell me what property I need to change, if I need to change something via c++ or blueprints, or if it is possible to make the spring osculate correctly?
Additionally changing the mass of the osculating cube does not effect the frequency of osculation. This doesn’t seem accurate so if you could explain that as well it would be appreciated.
Thank you,
Have you tried waking the cube on the bottom. It may not be running its simulation.
I can not wake the cube on the bottom as it is not simulating physics. I duplicated the original actor and changed the bottom cube to simulate physics and locked it’s position and rotation and the system damps at a completely different rate. That too is unexpected as only changing the bottom cubes simulating physics property shouldn’t change the spring motion.
Have you adjusted the damping on the constraint?
Yes the linear and angular damping are both set to 0.
Actually there isn’t a damping value you can change for a free physics constraint. You can only change the damping for limited and that doesn’t produce the desired effect either.
Once you start a simulation in the details window of a physics constraint additional properties appear. These properties do not seem to be editable in C++, blueprints, or the properties panels. Here is an attached image showing the properties in the window.
According to Nvidia:
https://gameworksdocs.nvidia.com/PhysX/4.1/documentation/physxguide/Manual/Joints.html#custom-constraints
The linear drive model for the D6 has the following parameters:
- target position, specified in actor0’s constraint frame
- target velocity, specified in actor0’s constraint frame
- spring
- damping
- forceLimit - the maximum force the drive can apply
- acceleration drive flag
The unreal interface details window only displays the position velocity and force limit properties with an additional strength property. I’ve tried to edit the other properties in C++ with no luck.