Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: westingtyler on June 12, 2018, 08:02:50 PM

Title: error: GetSceneName : Scene index "1" is out of range.
Post by: westingtyler on June 12, 2018, 08:02:50 PM
There are 65 scenes in my build, and I have a state that even gets that number to check against, and it works fine. But I get this error when I try to use Get Scene Name, using Scene at Index as Scene Reference:

create scene list : from build settings : get and stamp scene name : GetSceneName : Scene index "1" is out of range.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmLog:AddEntry(FsmLogEntry, Boolean) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:171)
HutongGames.PlayMaker.FsmLog:LogAction(FsmLogType, String, Boolean) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:392)
HutongGames.PlayMaker.FsmStateAction:LogError(String) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmStateAction.cs:207)
HutongGames.PlayMaker.Actions.GetSceneActionBase:OnEnter() (at Assets/PlayMaker/Actions/SceneManager/Internal/GetSceneActionBase.cs:92)
HutongGames.PlayMaker.Actions.GetSceneName:OnEnter() (at Assets/PlayMaker/Actions/SceneManager/GetSceneName.cs:32)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState:OnEnter() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm:Start() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1851)
PlayMakerFSM:Start() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:501)

and i get more of the same error, counting from 1 to 65 (the max number of levels in my build.)
Title: Re: error: GetSceneName : Scene index "1" is out of range.
Post by: djaydino on June 13, 2018, 08:51:38 AM
Hi.
I can confirm the issue, but it seems that the action only gets scenes that are in the hierarchy and not in the build.

I did some research on the unity forums and it works differently that in-scene so i made a new action.

you can get it from the attachment below.
Title: Re: error: GetSceneName : Scene index "1" is out of range.
Post by: Doh on September 23, 2018, 11:42:57 AM
This was exactly what I needed, thanks djaydino!