# Incorporating Player

So far, the information we have learned should be enough for you to easily start using RSB in your own player controllers & character systems. However, if you don't have your own character system, or if you want to build upon a base, you can use the example first-person controller provided by RSB. Let's change the tutorial scene such that instead of firing from the main camera, we will fire from the player camera.

First, delete the Main Camera object. Then navigate to **InanEvin>Realistic Sniper and Ballistics>System Prefabs** folder and drag & drop the **Player Without Weapon** prefab into the scene. Position it to **0,1,0.** Then go over our **Tutorial** object, you will see that the Main Camera is missing. Drag & drop the **Main Camera** under the player prefab in the hierarchy. Then go to the **Sniper and Ballistics** object and assign the same **Main Camera** to the **Fire Transform** field of the SniperAndBallisticsSystem.cs instance. Next, go over to the **ScopeReticle** object under **CANVAS - Dynamic Scope System** where the DynamicScopeSystem.cs component is attached, and assign the same **Main Camera** under the player to the **Main Camera** field. Finally, open up our **Tutorial.cs** script, and modify the if block where we are firing to:

{% embed url="<https://gist.github.com/261333f5ae24fda45a675c455f6ea6e8.git>" %}

Remember we used to fire using **Space** key, but that will conflict with the **Jump** input of the player controller we just dragged in. Now, we have just switched that to the left-click mouse button.&#x20;

There is only a small thing left to do. The **Player without Weapon** prefab, as well as the other player prefab we will talk about in the upcoming sessions, are **layered** as **IgnoreRaycast**. This is only for the sake of the demo scenes, of course in your own project, you might want to raycast to the player, e.g. from an enemy, so you might want to put the player into some new layer like **Player**. But for the RSB package, we did not want to mess with your project settings & layers, so we have just put the player under **IgnoreRaycast.** Now, it is possible that when we fire from the player, the rays might hit any object under the player, if we were to have an object with a collider. That's why we want to bypass the player during our raycasts. Go to the **Sniper and Ballistics** object, and change the **Ray Mask** value to **Everything but IgnoreRaycast (Mixed).**

![Every layer except IgnoreRaycast is selected.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaOYVL4B6wsSUdDIVwG%2Fimage.png?alt=media\&token=dab52ad0-b494-4657-b60e-3a048d8cdbd0)

Since the player is in IgnoreRaycast layer, now the rays casted from our fire transform has no chance of hitting the player collider, or any object we put under the player if there were to be one.

If you play your scene now, you will be able to walk around, and shoot with the mouse left-click. Remember, you can also aim with right-click.

![Shooting with the example player controller.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaOQTnO5MlWPclmA0LO%2Fezgif.com-gif-maker%20\(18\).gif?alt=media\&token=483feb47-9b1d-4a0f-b26b-b612918b08de)

Let's also debug the bullet trajectory in-game. Create a new game object, call it **Trajectory Renderer Pooler,** attach the **ObjectPooler.cs** component on it. Then click on the search field of the **Pooled Object** field and assign the **Bullet Trajectory Renderer** prefab on it.

![New object created & ObjectPooler.cs attached, with Bullet Trajectory Renderer set as pooled prefab.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaOQv_jy3BBw5VZq-C1%2Fimage.png?alt=media\&token=8f446029-1a4e-4577-9839-aa79008bfd1e)

Then go over to the Sniper and Ballistics object, enable **In-game Debug** renderer settings, and assign this pooler to the **Trajectory Renderer Pooler** field.

![In-game Debug enabled, trajectory renderer pooler assigned.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaOREHm5I996tBVbcMO%2Fimage.png?alt=media\&token=cac64679-1029-4f2d-bbfe-4d5e6110ffe0)

Now if you play the game and shoot, you will see the bullet's trajectory being rendered with line renderers.

![In-game trajectory rendering.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNvVqmR0PSBBSvny79%2F-MaORoE2RPbj3yUEVyFZ%2Fezgif.com-gif-maker%20\(19\).gif?alt=media\&token=064c598f-da99-436d-9cb3-e6f665990d3b)

Let's take a look at the details of the player prefab we have just dragged in, just to understand how it works.
