Hello everyone. I have small question to ask, nothing special just about implementing another project to my main game project. I'm using ar2rsawseen's Multi Slider code and I found out it works with scene manager. I implemented it into my project and the multi slider code works great, but.. I imported the slider code into my onEnterEnd function and other buttons lost the functionality with the error:
classes/scenemanager.lua:287: attempt to index field '?' (a nil value)
stack traceback:
classes/scenemanager.lua:287: in function 'changeScene'
scenes/gamesc.lua:41: in function <scenes/gamesc.lua:37> |
I can see that slider uses sceneManager and a Sprite and I do believe I have to change the sceneManager code to something else so the other buttons could work. I tried addEventListener but none of my codes worked well.
I don't need full code or such, I'm here to ask some tips about what should I use to manage the slider and other buttons to work in the same time.
Thanks
Comments
I think that the issue is in your code: you should not change scenemanager unless you know why
output says that everything started at
scenes/gamesc.lua:41
What do you have here? You need to trackback from there, until you find the wrong parameter sent to scenemanager:changescene (...).
This is the gamesc.lua file. The line 41 is: "sceneManager:changeScene("storesc", conf.transitionTime, conf.transition, conf.easing)" .
without the full project is hard for me to debug.
how many SceneManager.new(scenes) do you have in your project?
I see you are creating one global sceneManager object at the end of gamesc.lua, but from your object name gamesc I suppose you already created one, in which you loaded this scene. Am I right?
Maybe you are overwriting the "old" sceneManager, and you're missing the previously defined scenes (where you should have defined "storesc")
Likes: tytadas