Objects no longer being drawn in top down shooter

Hello,
I’m new to Unity and just put together a prototype for a top down shooter. I’m having an issue where my bullets will disappear after they pass the point where the mouse was clicked. Bullet code:

public class BulletController : MonoBehaviour {

    public float bulletSpeed = 12;
    Vector3 direction;

    // Awake is called on Instantiation
    void Awake() {
        GameObject thePlayer = GameObject.Find("Player");
        Vector3 target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        Vector3 offset = target - thePlayer.transform.position;
        direction = offset.normalized;
    }

    // Update is called once per frame
    void Update() {
        transform.Translate(direction * bulletSpeed * Time.deltaTime);
    }
}

In the player script, a bullet is being instantiated at the player position every time the user clicks. Then as the bullet nears the point where the user clicked, it sort of deteriorates. It doesn’t just blink out of existence but decays within a few frames. The GameObject is not destroyed and can be seen in the scene editor but not the game view. Thoughts?

Cheers!
-CoconutBonce

maybe its too close to camera?
check, or try setting target.z same as player.z

I had a look at the scene editor in 3D and you were right! Your solution worked nicely cheers! :slight_smile: