Conversations break after changing scenes
Posted: Wed Aug 05, 2020 7:29 pm
Hi guys,
First off - great work on Dialogue System. I love it and it works really great for me. That being said, I'm having a problem that is potentially game-breaking going forward and so I need to know the best way to deal with it. However, I do feel I know the source of the problem so this may help.
So basically, I am working on an adventure-RPG game, similar to Zelda. The entire system is working great - I can enter dialogue with NPCs, trigger conversations quite easily and so on. That is, until the player character changes scenes through way of a scene-change portal.
After changing scenes by walking into the scene-change portal, the current player game object is now an instance of the game object, and so when I have conversations with NPCs, it isn't disabling player movement like it does just fine before you change scenes. I am sure this is something to do with the reference to the game object - in the 'Actor' field, the player prefab is selected. However, in the previous scene, the 'Player' game object is already pre-spawned in the scene. It is not spawned by way of any script. I believe this may be part of the problem. So my question is, basically, should I change the character object in the first scene (that an instance of is carried over into the second scene with inventory etc.) to be spawned from the same prefab I'm selecting as the 'Actor' in the dialgoue in question in the second scene? Will this fix the issue because the dialogue element will recognize that the instance of the player prefab is the same player object referenced as the 'Actor'? If I play the scene on its own without entering it from another scene, and with the player prefab already placed into the scene, the dialogue system functions correctly and will stop my player movement during dialogue. So the issue appears to be with loading the scene within play mode from another scene, as the player game object is NOT an instance in this case.
Apologies for the long winded explanation, just wanted to try be as specific as possible. Any help would be greatly appreciated, as I simply can't continue making dialogue events in my game without fixing this.
Cheers!
First off - great work on Dialogue System. I love it and it works really great for me. That being said, I'm having a problem that is potentially game-breaking going forward and so I need to know the best way to deal with it. However, I do feel I know the source of the problem so this may help.
So basically, I am working on an adventure-RPG game, similar to Zelda. The entire system is working great - I can enter dialogue with NPCs, trigger conversations quite easily and so on. That is, until the player character changes scenes through way of a scene-change portal.
After changing scenes by walking into the scene-change portal, the current player game object is now an instance of the game object, and so when I have conversations with NPCs, it isn't disabling player movement like it does just fine before you change scenes. I am sure this is something to do with the reference to the game object - in the 'Actor' field, the player prefab is selected. However, in the previous scene, the 'Player' game object is already pre-spawned in the scene. It is not spawned by way of any script. I believe this may be part of the problem. So my question is, basically, should I change the character object in the first scene (that an instance of is carried over into the second scene with inventory etc.) to be spawned from the same prefab I'm selecting as the 'Actor' in the dialgoue in question in the second scene? Will this fix the issue because the dialogue element will recognize that the instance of the player prefab is the same player object referenced as the 'Actor'? If I play the scene on its own without entering it from another scene, and with the player prefab already placed into the scene, the dialogue system functions correctly and will stop my player movement during dialogue. So the issue appears to be with loading the scene within play mode from another scene, as the player game object is NOT an instance in this case.
Apologies for the long winded explanation, just wanted to try be as specific as possible. Any help would be greatly appreciated, as I simply can't continue making dialogue events in my game without fixing this.
Cheers!