Shooting through the wall

Hello, please how can i do shooting through the wall like cod4

?

That’s funny that you posted a vid cause everyone on this planet should know what your talking about. lol

Are you using raycast or projectiles?

Don’t destroy bullets when they hit walls. Done.

I use raycast

Well, don’t hit the wall with the ray cast.

Why?

In these games they usually give bullets hit points. Whenever they hit an object, instead of getting destroyed, they loose a portion of their hit points and get a slight change in their direction. When all their hit points are <= 0, they get Destroyed. Different ammunition type has different hit points, and therefore, bullets fired by a glock will get destroyed faster (even in their first hit), than bullets fired by a .45 Magnum.

You can even take this idea further and give your bullets properties, like they have in real life (fragmenting, armor piercing, hollow point, soft point and so on), which will have different amounts of hit points and behave differently when hitting an object. It all depends to the level of realism you’re shooting for here.

Okay, thanks. As I have free time to try it.

So, put a bullet lives and when they hit an object they are so uber lives and if bullet have 0 lives bullet destroy? … Sorry for my english

to me it looks like the bullets never hit the wall.
he may be facing the wall, but when he switches to scope, he leans out from the wall.

idk. just my two cents

Yeah. You should also decrease the amount of damage they do based on how many hit points they lost. A bullet that went through a wall before hitting the enemy is going to deal less damage than a bullet that went right through him first.