Hello everyone, I am having a problem which my character, when ragdoll is turned on, falls through floor sometimes. Thank you in advance if anyone can let me know what is wrong; I believe it has something to do with my character’s physics setup.
I manage to create a simple project (based on the Side Scroller template) which demonstrates the problem:
- Create new project (C++ / Side Scroller / Mobile/Tablet / Maximum Quality / No Starter Content)
- Name the project test1
- Replace test1Character.h and test1Character.cpp in \test1\Source\test1\ with the attached test1Character.h and test1Character.cpp
- Build test1 in Visual Studio
- Open test1 in Unreal Editor and ignore the “Failed to find” errors because the mesh is not yet in the project
- Import attached test1.fbx to /Game/SideScroller/Character/Mesh/ in Content Browser (“Import All” with default settings)
- Save, close and reopen test1 in Unreal Editor
- Open test1_Physics_Asset, remove the primitive at Joint1 and make the primitive at Joint0 match the sphere mesh
Although the mesh is only a sphere, I have to make it a sketal mesh to ensure that the problem occurs to skeletal meshes.
Reproducing the problem:
When you hit play in the editor, the Mannequin is replaced with the “sphere character” and physics is turned on. Mouse-click or touch will “add impulse 5000 units vertically” (see function TouchStarted in test1Character.cpp). The sphere goes up, falls and collide with the floor.
Now, try double/triple click or touch so that the sphere goes higher than the ceiling or the wall in the background. I find that sometimes the sphere will fall through floor, but not always. If I make it way higher, it always falls through floor. Can anyone explain to me what is going on?