Asked a million times.
Blitz3D Forums/Blitz3D Programming/Asked a million times.
| ||
Bullet hole decals? How is it down based on a camerapick. |
| ||
Don't use Camerapick. Use Linepick to do a line from the front of the player, to infinity (well, a long way, anyway). If the first entity it hits is a enemy, you've got to deal the damage. IF however, it hits the map first (ie, a wall), then use the PickedTri() command to detect which triangle it picked on which surface, etc. Then use AlignToVector to put the bullet hole sprite flat up against (but just out.. say, 0.0001) from the wall. It'll be a little more complicated than that. You'll have to find out which way the triangle is facing (based on which way the verts connecting it are connected, relative to the player) to figure out which side to put the decal on - but it's relatively straight forward. Make sure your map mesh has EntityPickMode enabled on it, otherwise the linepick (or camerapick, etc) won't pick it. >_< Hope this helps. +BlackD |
| ||
It does. Thanks. |
| ||
I think an other solution would be to use the pickedNX etc. commands to determine the required decal rotation. then move t slightly away from the wall, using moveentity decal,0,0,0.001 |
| ||
Didn't the castle demo included with Blitz3D have this? |
| ||
I looked under the online manual for that command and found a very awesome example. |
| ||
Sorry it hit me the right way. Sounds like the start of a song ...asked a million times how to make bullet hole decals Rhyme. its kind of sublime but I asked a million times. put a timer on the sprite to make it go away |
| ||
Why go away at a time? In real life, Bullet Holes on walls dissapear at a time? Hehe, it is better to move them out when there is too much sprites on the screen and you need more... :) |
| ||
Yup, my functions deletes the first after the 200th is made. |