animation affecting game code

Blitz3D Forums/Blitz3D Beginners Area/animation affecting game code

Hi there,

I used biped animation in max and following a tutorial I found on the net, I exported it as a SMD format, and exported it out as a b3d format in milkshape.

The problem is my code no longer works. Here's a snip of my code:

Global gravity#

; loads the environment and my animated character
scene = LoadAnimMesh("env.b3d")
player = LoadAnimMesh("player.b3d")

ScaleEntity player, 0.5, 0.5, 0.5
PositionEntity player, 0, -77, 0
EntityType player, type_player
EntityRadius player, 2, 7.5

; ground is a plane in my scene
ground = FindChild(scene, "ground")
EntityType ground, type_ground

; setups collision
Collisions type_player, type_ground, 2, 3

While Not KeyHit(1)
gravity# = gravity# - .08

If EntityCollided(player, type_ground) Then
gravity# = 0
EndIf

TranslateEntity player, 0, gravity#, 0

UpdateWorld
RenderWorld

Flip

Wend

End

I try applying simple gravity to my player but the problem is when the game loads, the character just fell through the ground.

I also tried using the FindChild command to refer to my player (works for bones animation though if I use the FindChild command, but it doesn't seem to work for biped) but when the game loads, it returns with a memory access violation.

Anyone knows why?