Author Topic: Beginner - levelName resolves to '1. RFCs' unexpectedly  (Read 143 times)

Brainzout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Beginner - levelName resolves to '1. RFCs' unexpectedly
« on: December 10, 2016, 11:54:44 PM »
Hello,

I am attempting to use the example menu script as a starting point to build my own menu.

I have created my own script named "Net Manager" and renamed the "examples" string array to a "scenes" string array and populated it with my own scene names. (See "Net Manager" attachment)

Everything works fine on the Net Manager side (scene names show up correctly on the gui buttons etc. - see "Works Correctly" attachment) but when attempting to click the button, Unity attempts to load the '1. RFCs' scene that was linked up in the example. (see "Problem" attachment)

Where is mClient.onLoadLevel being called from? Why is levelName equal to '1. RFCs'? How can I change this? (See "Confusion" attachment)

Thanks in advance
Brainzout


Brainzout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Beginner - levelName resolves to '1. RFCs' unexpectedly
« Reply #1 on: December 11, 2016, 02:40:16 AM »
Update: It appears that the channelID has an effect on the scene name for some reason.

If I manually change the "i + 1" to be "0" in the "Working Correctly" attachment. The main scene is loaded as intended.
If I make it equal "1" it attempts to load the first example scene, "2" loads the second example and so on.. even though the example scenes do not exist anywhere in my project (I deleted them).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 254
  • -Receive: 1112
  • Posts: 21,707
  • Toronto, Canada
    • View Profile
Re: Beginner - levelName resolves to '1. RFCs' unexpectedly
« Reply #2 on: December 11, 2016, 10:50:23 AM »
The example server's channels are started with the persistent flag turned on, meaning the next time you try to join the channel it will use the existing level name rather than whatever you specified.

Delete the server.dat file and try again.