General Help with Unity

I work in C drive, then back up to flash drives once I am happy with the work I have done and/or made decent progress. But a nasty problem Unity still needs to fix is the following:

Backing it up to my flash drives causes some of scripts to produce an error, it no longer uses the name I gave the script. For instance, I gave a script name “score” but after saving it to flash drives, it produced an error so to fix it I changed “score” to “Score”.

Another problem: Not all my scripts work on all my levels. The score script only works on the first two levels in C-drive, yet works perfectly fine on my back up drives for levels 3+.

I did download the game from my C-drive idk if that messed anything up, but luckily only the score script doesnt work on levels 3+. And yes, I did everything I was supposed to.

i use something called github which is subversion code system. You can create with something called gitignore file and that means it only copies relevant files to githubs storage solution. very effective i feel.

No. Github is NOT subversion. Github is Git, hence it has “git” in the title. It doesnt “only copy relevant files”. Git copies everything that has been put into git, and stores every single change to every file within git. Thats the entire point of git and its ability to revert etc, whilst storing a local copy on the users machine. Subversion does not store a local copy, and is not git.

Please be careful about giving incorrect advice to people, and try to google what you are talking about before trying to seem like you know things. That way people wont get the wrong advice.

This time it was a minor mistake but you have already been told a number of times about telling people directly incorrect things (many of which certainly would derail a project and waste said users time) and pretending due to your inflated post count that you are a long time member with deep understanding of the knowledge when really you are completely new. Seriously, just stop doing it.

Just a few corrections; when one uses .gitignore, one does indeed exclude certain files from being put into git, but git still copies everything that has been put into git.
You selectively misquoted, seemingly in order to leverage a strawman. Please don’t do that.
And strictly speaking, files excluded by means of .gitignore could be relevant or irrelevant; their exclusion has nothing to do with relevance. Its all down to the contents of .gitignore.

Also, it is not Github which allows ‘branching and merging’. Git does that. Git is software which creates and accesses Git repositories. Github is a company which provides storage for Git repositories for people to use in conjunction with Git. Git can operate entirely independently of Github.

Also, a pet peeve about grammar; please learn more about it.
‘u’ is grammatically incorrect for ‘you’, ‘it’ is grammatically incorrect for ‘it is’ and ‘i’ is grammatically incorrect for ‘I’, all things wrong in your post, and thus things which you would expect to notice in *many other posts (*not ‘many of other posts’)
But while you’re in that glass house, lobbing rocks, GameDevCouple didn’t use ‘your’ incorrectly in their post above. The inflated post count belongs to you, so it is your inflated post count. They didnt use ‘its’ incorrectly, the ability to revert belongs to git so in relation to git, you are talking about its ability to revert. ‘Your’ and ‘its’ are what are called ‘possessive determiners’; they indicate something possesses something else, be that as an attribute or ownership or whatever.

You’re’ is a shortened form of ‘You are’. 'It’s’ is a shortened form of ‘It is’. Neither of these are correct when used to indicate a thing which possesses another thing.

Pronouns: possessive ( my, mine, your, yours, etc.) - Cambridge Grammar?

So that thing you say you notice; you’re actually getting it wrong. And it’s because your understanding of grammar is incomplete; its limitations are noticeable and don’t support you in trying to position yourself as a grammar authority.

So to reiterate: Please be careful about giving incorrect advice to people, and try to google what you are talking about before trying to seem like you know things. That way people wont get the wrong advice.

Oh, and don’t call me ‘sir’ as you always seem to do when corrected. Cheers.

If we are to be pedantic, Git is version control software.
Github is a site that can host Git repositories. One of the many sites capable of that.

From grammatical point of view, GameDevCouple used “your” correctly.
Here’s a guide:
https://theoatmeal.com/comics/misspelling

And if we’re talking about pet peeves, then you should probably drop use of “u” and “something called”.

“u” is textspeak slang used by teens. Not sure about other people, but when people use “u” instead of “you”, for me it creates a mental image of a brain-damaged or mentally impaired person trying to speak in slurred speech.

“something called” gives impression of you being condescending and treating the other person as an idiot. For example, people generally know what krita is. It is “krita” and not “something called krita”. Likewise, they also know what git is, what github is, and what gitignore is. You’re on a developer’s forum. This is a common knowledge.

Ok but does anyone have a solution as to why my script suddenly only works on the first two levels even though I did everything I was supposed to for the rest of the levels? Trust me, I looked it over tons of times.

You need to tell what the error message is, and how you’re backing up the files to flash drive. Or which OS you’re using.

Because it sounds like you’re using 3rd party software to make backups, and it is renaming files while making a backup. Which is not something that should be happening during normal operation.

You need to start with providing error messages you’re getting.

“It doesn’t work” does not give any useful information. Because there are millions of way for something to fail to work.

whilst it is true it may be corrupt flash drive or operating system transfer problem it is really advised to use more robust tool like github or svn. you just side stepping bigger issue down the line.

Github or svn, it’s like saying you should use Chiquita or apples

Edit: svn is a version control tool and github is a hosting service for git repositories

Edit2: I see this topic have already been covered :slight_smile:

yes we have cleared up confusion and provide OP with best advice to continue. github ftw :slight_smile:

I dont think showing the codes will mean anything but I am desperate so here it is: Just remember, it was working just fine on C-drive until I backed it up. Though I did download the game too. These same exact scripts are attached to the same things in each level, yet the score only goes up on the first two levels. Keep in mind the score does show up on every level.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class score : MonoBehaviour
{

    public static int ScoreValue = 0; //starts the score at 0 
    internal static int lastScore;

    Text Score;

   void Start()
    {
        Score = GetComponent<Text>();
    }


    void Update()
    {
        Score.text = "Score: " + ScoreValue;
       
    }

}

This script is supposed to make the score go up after the object gets destroyed:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

{
   
    public Font font;
    public GameObject gameobject;


     public static int itemcollected = 0;
    public int lastitemCollected = 0; //game keeps track

    public static int scoreValue;
    private int currentlivesvalue;
    private int lastScore = 0;
   

  private void Start()
    {
       
        TextGenerationSettings settings = new TextGenerationSettings(); //need this to use different font settings.
        settings.fontSize = 8;
    }

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.name == "Player1")


        {
           
         
            Destroy(gameObject); //destroys the item "collects it"
            SoundManager.PlaySound("keyHit");
           
score.ScoreValue += 50; //score increases by 50 after collecting it
            lastitemCollected += 1;
            itemcollected += 1;
        }

then there is a bug on third level and levels above this.

but how do I find the bug? I compared it to the version on my flash drive and I saw no differences.

Github has a size limit if you do not pay so it’s not a win for everybody. We use Microsoft devops it’s git hosting has alot higher limits atleast up to 5 developers and that includes alot of indie teams, mine included.

maybe u should not use ‘static’ variable. Same like in cplusplus where the ‘const’ keyword is generally to be avoided at all costs.

im using Unity version 2018.3.8

But its the same version on all of my drives.

Ah that is cool, we just have small file so far for skeleton prototypes.

What’s nice with git (the versioning tool not github) is that it’s distributed so the day you outgrow github (the hosting service not the versioning tool) you can just add your new remote and push to it and all history and everything will be kept.

that’s cool to know, github seems ok so far, esepcially since i learned about the .gitignore file which has save a lot of space, maybe with LFS support it will be better, but i rather use it for keeping base starting templates rather than full projects. We have many projects on the go (see signature.)

I am only developer, my friend, she does all the graphics for me.