playMaker

Author Topic: Get Total Level Count (in this build) as Int?  (Read 2937 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Get Total Level Count (in this build) as Int?
« on: May 24, 2018, 10:08:07 AM »
Hello. I want the player to press a button and load a random level from 0 to X, X being the total number of levels in the game. It would be very handy in development to be able to grab the total number of levels in the build and operate on that. Is this possible?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7620
    • jinxtergames
Re: Get Total Level Count (in this build) as Int?
« Reply #1 on: May 25, 2018, 10:18:13 AM »
Hi.
You can use "Get Scene Count In Build Settings"

deduct all others scenes (that are not level scenes) in your build setting and you will have the total level count.

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Get Total Level Count (in this build) as Int?
« Reply #2 on: May 31, 2018, 01:01:38 PM »
Thanks. a quick question: what kinds of scenes could NOT be levels? Is that like, title menus, options menus, etc? (In my VR game even the title screen is a place you can walk around.)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7620
    • jinxtergames
Re: Get Total Level Count (in this build) as Int?
« Reply #3 on: May 31, 2018, 06:39:32 PM »
Hi.
It can be several things depending on your project.
Especially if you use load scenes async additive, like a tutorial i recently made (see video below)