Walking Chars

Blitz3D Forums/Blitz3D Beginners Area/Walking Chars

Gord(Posted 2005) [#1]
How do I stop an anim character walking thru walls?


Matty(Posted 2005) [#2]
set up collisions something like this

[code]
Const Creature=1,Scene=2

myanimatedcharacter=loadanimmesh("your mesh here")
entitytype myanimatedcharacter,Creature
entityradius myanimatedcharacter,"radial size of your character assuming 0,0,0 is at the centre of your character"
level=loadmesh("your level file here")
entitytype level,Scene

collisions Creature,Scene,2,2



[code]

after that any meshes of with entity type 1 (creature) will collide and slide with any meshes of entity type 2 (scene).


jfk EO-11110(Posted 2005) [#3]
Well using collision isn't the last insight. You may use collision to trigger artifical intelligence to some degree. EG. when the character collides, he should turn around and try to walk other ways.

Personally I use waypoints. The characters do follow waypoints, so they never collide with walls. For simplicity I am recording these waypoint while I am walkin trough the level (storing positions every say 200 millisecs), controlling an FPS camera. No matter HOW I walk, the enemies will act the same way, that looks well, kind of, intelligent.