Can someone help with my gun problem pretty please? :)

I’m working on a simple fps with another classmate. I was just wondering if anybody can help with the issues I’m having.

The camera is fixed as the game is on rails.
So far I have added the crosshair and connected it to the mouse.
I am coding in Javascript but my colleague is using c#.
He has created the code for the current behaviour of the raycast, which you see below.

using UnityEngine;
using System.Collections;

public class FPSInput : MonoBehaviour {

	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetMouseButtonDown(0)){
            Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast (ray, out hit, 100)) {

                Debug.DrawLine (ray.origin, hit.point);
				
                if (hit.transform.tag == "Chicken")
                {
					print(hit.collider.tag);
			      
                    
                    Destroy(hit.rigidbody.gameObject,4.0f);
					Vector3 explosionPos = transform.position;
					hit.rigidbody.AddExplosionForce(5000, explosionPos, 25.0f, 1.0f);
                    }
               }
           }
	}
}

What I’d like to know is the following:

Is it easy to add a projectile so that the viewer can actually see the bullet instead of the result of the bullet?

How can I add a score so that it increases by 10 everytime a chicken is shot?

Many thanks in advance. I’m a complete beginner to this, but I have completed the fps tutorial. However I just can’t seem to apply the knowledge to my game, and the switch from javascript to c# has confused me

What do you mean “see the bullet”? Do you want to see the bullet itself, only the bullet trail(like in most fps games where trails are everywhere) or do you want a rocket of some sorts? To do so just instantiate an object(bullet) and push it forward either with transform or with rigidbody force. Note that this will not work well on fast moving objects and can sometimes cause it to go through walls or other abnormalies.

As for +10. When you detect a chicken is hit, you destroy the chicken and then just add to score, something like score+= 10

I want to throw a fork from the gun as a bullet. So i don’t need a trail, i just need the fork object to move along the correct line of the bullet. It worked very well when I was using the rocket launcher from the fps. But for this script i need it to aim at where the mouse is pointing and the easiest way of doing that was to use a raycast. My problem is I’m not quite sure how to integrate the two, I’d have a slight idea in Javascript, but I don’t know c#.

Yes I understand how the +10 works. but should the score be part of the code i’ve shown above? Or does the score need to be declared somewhere else and just added to here? I’m still googling how to add the score as part of the GUI but like I said this is new to me. I would have thought that the code that destroys the chicken and adds to the score should be in another script attached to the chicken?