Forum rules - please read before posting.

Switching player doesn't work correctly in build

edited August 2014 in Technical Q&A
Hi Chris or someone else who have the same issue.
I recently used the function to switch the player and in the Run game window of Unity it works without any problems.
But when I create a build, when I switch the player he lost the portrait graphic texture and the text colour... the text colour become white, like if no char is selected to speak...
I used this function to replace the face of the player for a while with a mask, so I have 2 identical prefab (I duplicate the original) exept for the face. 
I put the player switch with the new one with replace current player. In Unity it's ok, in the build no... it's a bug?

Comments

  • Have you placed these files in a Resources folder?  That's the main difference between build and editor games: Unity can only search folders named Resources when in built games.
  • edited August 2014
    I'll check, but I think you're right, in resources I have the prefab player but not the portrait... but I don't understand why also the color is reset to white... I'll let you know! Tx for now!

    EDIT: I just checked, the portrait are under the folder Resources\2d_portrait so they are in the right position...

    EDIT2: the first time I switch the player with the prefab with mask, he lost portrait and text color, but he makes main char disappear. I go ahead and when I remove the mask, appear the main char WITH the char with mask... so there are 2 player... I control the last without the mask... this also happen in the editor game. If after the switch player - replace current player, I put an Object - PlayerWithMask - Kill, in the editor it works (with a 0.5 second freeze but works).

    I tried to set the tag of the prefab to 1) both player and 2) 1 player and 1 untagged but nothing change.
  • I solved by using a workaround... the PlayerWithMask has become an Npc, in an hidden position. When Player put on the mask, he goes to the MarkerOut and i teleport the PlayerWithMask where there was the Player. After played its animation, he put off the mask and teleport him out and player in. No freezing and quite credible.

    Sorry but I have to distribute the demo to my beta tester (my friends, eheh) and I promised them to send it today so I wanna make them happy.

    And when I can translate in english, I will publish also here, of curse! :D
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.