Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<Character name ="carp" humanoid="false" health="225" doesbleed="true">
<sound file="Content/Characters/Crawler/attack1.ogg" state="Attack" range="500"/>
<sound file="Content/Characters/Crawler/attack2.ogg" state="Attack" range="500"/>
<sound file="Content/Characters/Crawler/idle1.ogg" state="None" range="500"/>
<sound file="Content/Characters/Crawler/idle2.ogg" state="None" range="500"/>
<ragdoll headposition="100" headangle="0"
waveamplitude="35.0" wavelength="2000"
swimspeed="3.0" walkspeed="1.5"
stepsize ="25.0,25.0"
legtorque="0"
footrotation ="0">
<!-- Head -->
<limb id = "0" width="64" height="140" mass = "6" type="Head" flip="true" steerforce="1.0" armorsector="0.0,180.0" armor="10.0">
<sprite texture="Content/Characters/Carp/carp.png" sourcerect="5,45,75,150" depth="0.02" origin="0.5,0.5"/>
</limb>
<!-- Mouth -->
<limb id = "1" width="34" height="58" mass = "4" flip="true" pullpos="-4,19" armorsector="0.0,180.0" armor="5.0">
<sprite texture="Content/Characters/Carp/carp.png" sourcerect="85,55,38,58" depth="0.021" origin="0.5,0.55"/>
<attack type="PinchCW" range="300" duration="1.5" damage="25" stun="2" bleedingdamage="74" structuredamage="25" damagetype="slash"/>
</limb>
<!-- tail -->
<limb id = "2" width="50" height="50" flip="true" type="Tail">
<sprite texture="Content/Characters/Carp/carp.png" sourcerect="12,187,58,60" depth="0.035" origin="0.5,0.5"/>
</limb>
<joint limb1="0" limb1anchor="10,8" limb2="1" limb2anchor="-10,-19" lowerlimit="-22" upperlimit="5"/>
<!-- body to tail -->
<joint limb1="0" limb1anchor="0,-70" limb2="2" limb2anchor="0,25" lowerlimit="-20" upperlimit="20"/>
</ragdoll>
<ai attackhumans="100" attackrooms="10" attackweaker="50" attackstronger="-100"
sight="3.0" hearing="3.0"
attackcooldown="4.0"/>
</Character>
This should work. Since you didn't post the code for the tail I don't know what the problem was, but the mouth issue was caused by incorrect positioning of the physics collider of the mouth:
The red rectangle is the sprite of the mouth, and the smaller white rectangle inside it is the collider. You seem to have moved the joints (the red dots) to make the sprite appear in the correct position even though the collider isn't there, which caused some weird behavior when the character was flipped around.