Weapon Collision

Blitz3D Forums/Blitz3D Programming/Weapon Collision

Gauge(Posted 2004) [#1]
What is the general way to do weapons? Should I load the weapon as a child entity and parent it a the pivot? Or should I make it a new surface on the model. Say I do a sword, if i put collisions on the sword can i get it to just appear like it goes thru the object? Or if the sword collides with something, should i stop the animation sequence? How do you guys do this?


Jeroen(Posted 2004) [#2]
depends on the genre. If you need realism, I suggest indeed parenting the weapon on the character because it will move and rotate with the parent. Easy and rewarding :-)
Then simply do a collision between the weapons and use variables (e.g booleans) to keep track of if the user was slashing the other player, instead of just collision.


vibe37(Posted 2004) [#3]
Say I do a sword, if i put collisions on the sword can i get it to just appear like it goes thru the object?

I think that's not possible with the standard collision commands but you should check out the command MeshesIntersect!

Kungfista


Gauge(Posted 2004) [#4]
Cool, thanks guys


Jeroen(Posted 2004) [#5]
Say I do a sword, if i put collisions on the sword can i get it to just appear like it goes thru the object?


Take in account that MeshesIntersect is rather slow. Blitz doesn't have "no responds collisions" so I guess it will be a good option. You could check using MeshesIntersect e.g 1 out of 5 in a loop.


AntonyWells(Posted 2004) [#6]
The way I did it in sota was to cast a line pick from the base of the weapon to the tip of the weapon. With the world collision meshes set to polygon pick mode. If it hit's something, your weapon is touching geo.

Worked fine.