Forum rules - please read before posting.

GetNumEnabledOptions of topics from a Conversation Prefab not updating

I'm having an issue using the GetCount() and GetNumEnabledOptions() functions for a conversation that is "Global" and works through a prefab. When I try these, it always returns the number of topics that were enabled by me initially and doesn't update when this number changes in the game.

I tested them out on a non-prefab conversation and they work perfectly, so I'm not sure how to go about this exactly. The global conversation loads in with the startup scene and has a "do not destroy" script. I'm checking that conversation object with my script for changes. Enabling and disabling the topics does work fine in game, but for some reason the number from the functions doesn't reflect that.

Any ideas would be very appreciated!

Comments

  • Those functions don't cache any values - they'll calculate the results based on the live data of their own options. Are you certain you're referencing the Conversation object that's in the scene, and not the prefab asset fie?

  • For some reason when I attached the getCount script to a separate gameObject in the scene and referenced the prefab conversation, it worked! I had the getCount script on the prefab conversation itself, referencing itself, previously. Huh. Anyways, problem solved, thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.