0
$\begingroup$

I am trying to recreate something similar to the Creative mode of Minecraft. I have added a basic logic brick to destroy a block when we over the mouse and push the left click. But the ray goes through every meshes so when i click it removes the meshes behind at the same time.

How can i avoid to destroy the cubes behind ?

enter image description here

$\endgroup$
  • $\begingroup$ it is blocked by other objects by default, You have to go to extra trouble so other objects don't get in the way. $\endgroup$ – X-27 the fluffy unicorn Aug 27 '16 at 17:13
  • $\begingroup$ it isn't a problem of your ray going through the mesh, it when you left click, it removes the block, but then instantly, in that same logic tick, the ray is also contacting the block behind it, etc. $\endgroup$ – X-27 the fluffy unicorn Aug 27 '16 at 17:17
  • $\begingroup$ Because of that I suggest to activate the deletion operation only when the mouse key was pressed (not while it is hold). This forces the user to release the button before deleting the next block. $\endgroup$ – Monster Aug 29 '16 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.