How do you destroy a mesh upon colision?

Blitz3D Forums/Blitz3D Programming/How do you destroy a mesh upon colision?

AvestheFox(Posted 2004) [#1]
Like say.. you have your player going around colecting 3D gems.. you would have to have those gems disapear (or be destroyed) as the player mesh colides with them... how do I code this?

Okay.. knowing I had B3D for more then 4 years, this may be concidered a litle emberasing in my asking... but to be honest, I've been too lazy to ask questions like this on the message boards.... So to my fellow B3D users, forgive my ignorance ^_^;;


Jeroen(Posted 2004) [#2]
Do you want to know how the collision detection works (e.g player with bullet) or how to delete the bullet in its whhole?


AvestheFox(Posted 2004) [#3]
how to delete


semar(Posted 2004) [#4]
You can simply use the FreeEntity command to permanently delete an entity from the 3D world.

Or you can make it slowly disappear by using EntityAlpha, and once it is completely transparent, then delete it using the FreeEntity command.

Look at the docs and the example about it: http://www.blitzbasic.com/b3ddocs/command.php?name=FreeEntity&ref=goto

Okay.. knowing I had B3D for more then 4 years, this may be concidered a litle emberasing in my asking... but to be honest, I've been too lazy to ask questions like this on the message boards.... So to my fellow B3D users, forgive my ignorance ^_^;;

Learning is a beautiful experience which never ends. :)

Hope this helps,
Sergio.


Neochrome(Posted 2004) [#5]
Learning is a beautiful experience which never ends. :)

Deffo!!

could do
[code]
for i=0 to countcollisions(player)-1 ; (i think)
ref = entitycollided(player, coll_world) ; return what you just hit!
freentity ref
; or
entityalpha ref,0 ; hiding it, but keep the object
next