Collision Questions

Blitz3D Forums/Blitz3D Beginners Area/Collision Questions

Crazy4Code(Posted 2005) [#1]
I am making the planes die when they hit the ground, but since I have to use "Collisions 2,4,3,1" with the last number being stop, they stop and don't do anything. I don't want them to slide or anything either. Is there a way to not use that or something?


GfK(Posted 2005) [#2]
Erm, what do you want them to do?


Crazy4Code(Posted 2005) [#3]
I want them to die... lol. I already have the function for that and I called it and everything, but it seems like since it stops first, it won't do the function.


Caff(Posted 2005) [#4]
If you want to do something when the plane hits the ground (rather than just colliding) you need to use a check to see if its happened - otherwise collisions just do their thing:

If EntityCollided(plane, 4)) then
  ... code here ....
End If

put this in your main loop, after you update the position of the plane.

This is assuming you have set the entities plane and ground like this earlier on in the code:

EntityType plane, 2
EntityType ground, 4


Crazy4Code(Posted 2005) [#5]
I did exactly that, except I put it in a function which is called from the main loop called AI()


Crazy4Code(Posted 2005) [#6]
It seems like, instead of doing the function, it just does the collision number. Maybe I have it ordered wrong???


Crazy4Code(Posted 2005) [#7]
Fixed that problem, but now, I have a collision that just doesn't seem to work at all. It's a sliding collision. Here it is:

EntityType ground,2

EntityType player\entity,1

Collisions 1,2,2,1

What's wrong?
It's worked with my other games. I don't see any difference.

P.S. I have UpdateWorld


RiverRatt(Posted 2005) [#8]
Did you remember to put and entity radius on the source entity?


jfk EO-11110(Posted 2005) [#9]
Did you make "plane" global etc.?


Crazy4Code(Posted 2005) [#10]
oh! No. Maybe that's it. I'll try it.