Question: I'm working on an FPS game. I want to make a little bit of difference in shooting direction, only on the horizontal axis.

To do this, I wrote this code:

```
Temp_Shake_Horizontal.x = Random.Range(-0.1f, 0.1f);

if (Physics.Raycast(the_camera.position, the_camera.forward + Temp_Shake_Horizontal, out BulletDecal_Hit, Mathf.Infinity))
{
     Quaternion HitRot = Quaternion.FromToRotation(Vector3.forward, BulletDecal_Hit.normal);
     decals_Objs[decal_Index].transform.position = BulletDecal_Hit.point;
     decals_Objs[decal_Index].transform.rotation = HitRot;
}

```

But I don't know why, when I rotate the camera, the result is changing!

Here is what it looks like when I face in one direction (this is the intended result):

[![Image of bullet holes on wall, showing random spread](https://i.stack.imgur.com/dDp0H.jpg)](https://i.stack.imgur.com/dDp0H.jpg)

But when I rotate the camera about 90 degrees to the left or right, the result is no horizontal variation: the bullets all line up in a vertical column.

[![Image of bullet holes making a sharp vertical line](https://i.stack.imgur.com/D67Se.jpg)](https://i.stack.imgur.com/D67Se.jpg)

Why does this happen, and how can I solve this issue? I want the result to always be like the first picture, with random variation side-to-side.

Answer: 
```
Temp_Shake_Horizontal.x = Random.Range(-0.1f, 0.1f);

```

This shake is always applied along the world x-axis. That means, if you're aiming along the world x-axis, the shake is being applied forward & backward along your direction of fire (ie. not changing the direction).

To apply the shake relative to your current facing direction, do this:

```
Temp_Shake_Horizontal += Random.Range(-0.1f, 0.1f) * the_camera.right;

```

You'll want to clear this shake out between uses so it doesn't accumulate - I assume you're already doing that based on the `Temp_` name on the variable, but I can't see that part of your code, so you may need to make additional tweaks.
Actually my problem solved by this way : 

```
Temp_Shake_Horizontal = Random.Range(-0.1f, 0.1f) * the_camera.right;

```

without +