Hello guys,
Please, can someone provide me with tips and a little basic tutorial on how to create a ragdoll for a character?
This is the code that I came up with, but the ragdoll is not working.
// Project: ragdolltest
// Created: 2019-12-15
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ragdolltest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetPrintSize(21)
Create3DPhysicsWorld()
LoadObjectWithChildren(1, "soldier.X")
SetObjectPosition(1, 0, -75, 100)
CreateObjectBox(2, 555, 1, 555)
SetObjectColor(2, 100, 100, 100, 255)
SetObjectPosition(2, getobjectx(1), getobjecty(1) - 15, getobjectz(1))
Create3DPhysicsStaticBody(2)
Create3DPhysicsRagDoll(1, 100)
firstbone = Add3DPhysicsRagDollBone(13, 25, 5, 0, 0)
Finalize3DPhysicsRagDoll()
do
for bns = 1 to 30
print(GetObjectBoneName(1, bns))
next bns
Step3DPhysicsWorld()
Print( ScreenFPS() )
Sync()
loop
Thank you so much!
www.alexmatei.com