Deed not working after scene changed?
Deed not working after scene changed?
This might be a basic question, but I'm uncertain about what I might have overlooked. In Scene A, with multiple characters, everything works as expected when I perform a Deed, and the affinity of faction members changes accordingly. However, upon switching to Scene B, performing a Deed doesn't seem to have any effect; the affinity remains the same. Even when I return to Scene A, there is no change in reaction. Any suggestions on what I should do?
Re: Deed not working after scene changed?
Hi,
Are there any errors or warnings in the Console window?
Does the FactionManager survive scene changes?
Are there any errors or warnings in the Console window?
Does the FactionManager survive scene changes?
Re: Deed not working after scene changed?
Hi Tony,
I fixed it! I needed to have the FactionMember game object activated by default in the scene.
For you information, this is what happened in my situation:
In my scene, there's a GameObject called 'GameplayManager' serving as FactionManager's parent. I've set it up using a singleton, and it activates all its children if it's the only instance. After examining the code, it seems that the variable 'members' in FactionManager has a zero length when committing after the scene loads(the length is 1 before loading the scene) if I have it disabled by default .
![Image](https://i.imgur.com/F78wj7R.png)
![Image](https://i.imgur.com/N8KRzut.png)
![Image](https://i.imgur.com/TweEAk3.png)
Thanks for your help!
I fixed it! I needed to have the FactionMember game object activated by default in the scene.
For you information, this is what happened in my situation:
In my scene, there's a GameObject called 'GameplayManager' serving as FactionManager's parent. I've set it up using a singleton, and it activates all its children if it's the only instance. After examining the code, it seems that the variable 'members' in FactionManager has a zero length when committing after the scene loads(the length is 1 before loading the scene) if I have it disabled by default .
![Image](https://i.imgur.com/F78wj7R.png)
![Image](https://i.imgur.com/N8KRzut.png)
![Image](https://i.imgur.com/TweEAk3.png)
Thanks for your help!
Re: Deed not working after scene changed?
Hi,
Thanks for your explanation. I'm glad you got it working. I think what's happening is that the FactionMember can't find the FactionManager since it's inactive, so it's unable to register itself with the FactionManager.
Thanks for your explanation. I'm glad you got it working. I think what's happening is that the FactionMember can't find the FactionManager since it's inactive, so it's unable to register itself with the FactionManager.
Re: Deed not working after scene changed?
It makes sense, thanks for sharing!