My game glitches, multiple pins shows up

I have some problem with the Bowl Master game.
When I enter the game mode and start playing, the ball will roll over the table and when it reaches the pins, a lot of pins shows up (like frozen windows with windows xp)

but if i pause the game and go to the scene view the pins are only 10 (the perfect number)
I don’t think that it’s a code related error because the pins doesn’t have a code (only the rigidbody not 2d) and the ball have only this code

public class Ball : MonoBehaviour 
{
	public float launchSpeed=10f;
	private Rigidbody rigidBody;
	private AudioSource audioSource;

	// Use this for initialization
	void Start () 
	{
		rigidBody = GetComponent<Rigidbody>();
		audioSource = GetComponent<AudioSource>();
		Launch();
	}

	public void Launch()
	{
		rigidBody.velocity = new Vector3(0, 0, launchSpeed);
		audioSource.Play();
	}

	// Update is called once per frame
	void Update () 
	{	
	
	}
}

and the camera have this one

public class CameraControll : MonoBehaviour 
{
	public Ball ball;
	private Vector3 offSet;
	
	// Use this for initialization
	void Start () 
	{
		offSet = transform.position- ball.transform.position;
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (transform.position.z <= 1800f)
		{
			transform.position = ball.transform.position + offSet;
		}
	}
}

I’ve tried to change speed to slower one, but it’s not that the problem

Hi,

(like frozen windows with windows xp)

Almost any version of Windows I’d say :wink:

Regarding the issue, if you want to zip up the project files and share it with me I’ll take a look, we can see if the project exhibits the same behaviour on my laptop too.

The forum will allow uploads of up to 10mb, so, if your zipped project files are larger than this, please use a service such as Google Drive or Dropbox and share the URL. Happy to take a look :slight_smile:

On a related note, your second screenshot is outputting an error message at the bottom, might be worth a look.

BowlMasterByFrank.zip (3.0 MB)
I’ve deleted some files that I’ve not used yet (the font and the skybox) and now I don’t get any Error (the red ones) but the problem still remains. Thank you very much.
EDIT: I’ve found the error, the camera’s “Clear Masks” was set on “depth only”

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms