Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Question I neep help with my score system

Discussion in '2D' started by Suleyman-r, Aug 26, 2020.

  1. Suleyman-r

    Suleyman-r

    Joined:
    Feb 29, 2020
    Posts:
    4
    I'm beginner at unity and C# and I couldn't figure out this problem.

    So I have 2 gameobjects that spawns while playing the game and they destroy each other on collision.
    I want to increase score on every collision,but the score goes like: 0, 1, 1, 1, 1.
    I guess everytime the gameobjects get destroyed my veriable starts from 0 again.

    Thanks for any help !
     

    Attached Files:

    Last edited: Aug 26, 2020
  2. blade_runner82

    blade_runner82

    Joined:
    Aug 17, 2020
    Posts:
    4
    You have to submit your code by pressing the Code: piece on the writing editor. We cannot help you like this.
     
    Suleyman-r likes this.
  3. Suleyman-r

    Suleyman-r

    Joined:
    Feb 29, 2020
    Posts:
    4
    Can you check now please