Search Unity

Question Can't move character after duplicated it on a new scene?

Discussion in '2D' started by raining_day0513, Oct 22, 2020.

  1. raining_day0513

    raining_day0513

    Joined:
    Dec 3, 2019
    Posts:
    9
    I want to make a new scene from the current scene, and I just created one and copy-pasted(cmd+c, v):

    1. The character(hero)
    2. The grid
    3. The canvas

    after that I also did "Removed Scene" to the scene that I copied from, so it was not shown on the scene tab anymore --- (1).
    After finished so, I clicked the play button and the game acted strangely that:

    1. When I pressed <left arrow>, <right arrow>, <down arrow>, <up arrow> on my keyboard, the character cannot move, only heard a "Dung" (warning?) sound. Why?
    2. If I revert the step --- (1) above, then two duplicate characters shown in the scene (overlapped I think), can move. Why?

    And I did try to duplicate this problem on another computer(package manager checked, script attached to the character checked, all the same), but no problem occurred. Why?

    The Unity version I'm using is 2020.1.8f1.
     
    Last edited: Oct 22, 2020
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511
    Have you tried copying the Scene itself, then removing those gameobjects you don't want? That way you're not manually copying things, perhaps forgetting something. Does that work?
     
    raining_day0513 likes this.
  3. webox

    webox

    Joined:
    Aug 27, 2015
    Posts:
    72
    A few things,
    1. What you did should work if no other scripts/scene objects are involved in making the character move
    2. Were you using the mac version? it could be a bug of that version
    3. But, why were you copy-pasting the character? it could be better to save the character as a prefab and just reuse it on the other scene
    4. As mentioned above, you can also duplicate the scene and start working from there
    cheers!
     
    raining_day0513 likes this.
  4. raining_day0513

    raining_day0513

    Joined:
    Dec 3, 2019
    Posts:
    9
    Thanks for your help first, and regarding:

    1. Yes, It works on another mac(I have tested it on my friend's computer, I did the same and it works on that computer, not mine.)
    2. I haven't checked, I will reply you later.
    3. I'm new to Unity, thanks for the idea about best practice. :)
    4. Yes, I will try it, thank you!

    happy day~
     
    webox likes this.
  5. webox

    webox

    Joined:
    Aug 27, 2015
    Posts:
    72
    Awesome! Yes take a look into prefabs You'll use them a lot, it's one of the most core parts of unity
     
    raining_day0513 likes this.