Page 1 of 1

Interactable objects in world

Posted: Wed Jan 10, 2024 10:52 am
by Trashrat
Hi,

I'm creating a msall adventure game that has interactable objects within the world, when the player clicks on certain objects ther will be a line or two of text given about them. In order to not create a new conversation with every object, what would be the best way of organising and going through this?

So far I have tried creating a placeholder actor called Interactive Item, then setting the actor's name to the object's name in Dialogue Actor script on the object. Then in the database i'm checking if the name equals the object name to play the right dialogue entry, but unfortunately it isn't working. I may have my understanding completely wrong.

Re: Interactable objects in world

Posted: Wed Jan 10, 2024 11:06 am
by Tony Li
Hi,

Try:

Code: Select all

Variable["Actor"] == "Fireplace"
Here's an example:

DS_InteractableItemExample_2024-01-10.unitypackage

Re: Interactable objects in world

Posted: Wed Jan 10, 2024 11:38 am
by Trashrat
That's great, thanks very much for the help. Does this way scale well? If there were say 20-30 or so actors, all checking those saem conditions within the one conversation?

Again, thank you for your time and help that's working great.

Re: Interactable objects in world

Posted: Wed Jan 10, 2024 12:53 pm
by Tony Li
Each condition takes a little time to evaluate, so you might want to split it up. Maybe 10 actors per conversation, give or take, depending on the CPU budget for your game.