Hey! I'm helping a friend with a game and i have a very BIG problem. I have to check if the object1 is over the object2 (object1 collide with object 2).
note:on the code below i will skip some lines of my original code
1 2 3 4 5 6 7
IModel* Marble = marbleMesh->CreateModel(0, 0, 0);
IModel* Mushroom1 = mushroomMesh->CreateModel(-70, 0, 90);
//here i get the coordinates of the marble after moving around
Dx = bullet->GetX() - marble->GetX();
Dz = bullet->GetZ() - marble->GetZ();
//next i have to check if the coordinates of the marble are
the same of the mushroom but i don't know how to do that
So as you can see to do this correctly, you need to define some threshold to be distance that the bullet must be from the target to correctly say that a hit has occurred.
This threshold value should be the maximum distance the bullet moves for each tick of the game.
hi! the bullet is the same object with the marble...i have to find if the marble-bullet collide with the mushroom. I'm trying to find a way so i can get the x and z of the mushroom and check if the marble coordinates are the same with the mushroom coordinates....
for example:
these are the coordinates of the mushroom