Weird Collision Problem
Blitz3D Forums/Blitz3D Programming/Weird Collision Problem
| ||
I've come across something that may be a bug or maybe its just the fact I'm tired O.o I'll try and keep it short, this is the problem. I have set up collision between the player and a mesh. The collision is of this type EntityType player,Col_Player EntityType mesh,Col_Object Collisions Col_Player,Col_Object,1,1 so that's sphere to sphere and stop response. The collision itself works fine, if I approach the object from any angle I stop, great. The problem is that EntityCollided(mesh,Col_Player) returns false even though a collision has occured and been reacted to. Any ideas? |
| ||
EntityCollided will only recognise the source entity in a collision so only EntityCollided(player,Col_Object) will return true in the above collision. |
| ||
Strangely the way I was doing it worked initially. I could walk into the object and push it around the room using the inverse of the collision normal. As soon as I picked up the object ( using entitypick (camera,100) and parented it to the camera so that it moved with the player ) then put it down ( using entityparent mesh,0 ) it no longer gave me a collision list but still gave the collision response. Changing it to your suggestion seemed to work for a while but now its gone the same again...must be a bug inhere somewhere..probably one of mine ^^ |
| ||
OK I've narrowed it down to what breaks the collision. Everything works OK until I pick the object up. When I pick up the object I parent it to the camera EntityParent PickedEntity(),p\camera I then drop the object by EntityParent PickedEntity(),0 from then on the object still collides but no list of collisions is generated and EntityCollided(p\body,Col_Object) returns false. Any ideas how I can reactivate the collision list? |
| ||
I've changed from loading a mesh to creating a sphere an now things work as expected. Im still not sure if it is a Blitz bug or a problem with the loaded mesh...have to run some more tests. |
| ||
In case you missed it, as the docs state for the Collisions command, only sphere style entities (entities given an EntityRadius) can be used as "source" in a collision. |
| ||
Thanks for that skid. Think i'd better get a pencil and paper out and get down cleary what I am trying to achieve =) |