playMaker

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

westingtyler

  • Full Member
  • ***
  • Posts: 158
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
Get Total Level Count (in this build) as Int?
« on: May 24, 2018, 07: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: 3178
    • View Profile
    • jinxtergames
Re: Get Total Level Count (in this build) as Int?
« Reply #1 on: May 25, 2018, 07: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

  • Full Member
  • ***
  • Posts: 158
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
Re: Get Total Level Count (in this build) as Int?
« Reply #2 on: May 31, 2018, 10:01:38 AM »
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: 3178
    • View Profile
    • jinxtergames
Re: Get Total Level Count (in this build) as Int?
« Reply #3 on: May 31, 2018, 03: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)