Hi there, I’m still slowly plugging away on this physics-based octopus game in my spare time. I’ve run into an issue with physics attachment and I think I’ve narrowed down where the root of the problem is. To summarize the problem, I have been trying to spawn a physics constraint at the hit location of a skeletal mesh and some other object. This works, but the physics constraint is left with an odd offset that causes some very strange behavior, as highlighted in this video:In this example, I spawn the physics constraint at the bone's reported location and enabled it, basically locking the bone in place at where it was when the On Hit event fired. As you can see, this bone (which has a small sphere for its physics volume at the end of the tentacle) is no where near the surface.
In this image, I’ve further narrowed the problem by spawning some marker spheres on where the On Hit Event is reporting that the bones are:
In the above image, I’m spawning physics constraints when the tentacles touch the green platform below the octopus. You can see that the spheres are no where near the surface where the tentacles are actually touching. The spheres are placed over a few times hitting the “Attach” button, that’s why they’re spread out over some distance around the platform. I’d expect them to be at the location of the bone when it touches the surface, which I would suspect would be very close to the surface since the bodies attached to the bones are very small.
In the next image, I’ve disabled the rotation in the tentacles caused by the physics simulation. This highlights that the location I’m getting (Using Get Socket Location) is actually the location for the bone at the bind pose, not where it currently is in the simulation.
You can see that the markers are all on the surface where the skeleton is touching. This behavior aligns with my suspicion where the location given by Get Socket Location doesn’t give the location for the bone in the simulation, but rather where it is in the bind pose. I’ve tried adding custom sockets to the bones, but the function gives the same results. Again these results are over a few times of hitting the “Attach” button, so that’s why they’re in a few different spots, but they’re all on the surface as I’d expect.
Anyone have any idea how I might be able to find the location of a bone in a skeletal mesh that is using its physics simulation to flop around?