Page 1 of 1
trouble with two npc sequential barks
Posted: Tue Mar 03, 2015 10:14 am
by njg
I would like to thank support for the previous quick response to my previous question. I have another. I am trying to replicate the 3 npc bark example, only with two npcs, and the two npcs call them mariah and jenny are supposed to go through this conversation and do a small info dump for the pc, but what happens is mariah (npc 1) is displaying her lines correctly, but jenny who is set up exactly (as far as I can tell) the same as both mariah and the npcs in the the 3bark example, is dumping her lines on screen for about 2 to 3 tenths of a second and handing off back to mariah, who then displays the next line for 3 seconds as desired.
Any ideas where to start looking, I have been digging for quite some time and am quite out of ideas.
Thanks in advance,
Nick
trouble with two npc sequential barks
Posted: Tue Mar 03, 2015 2:38 pm
by Tony Li
Hi Nick,
For Jenny's lines, try setting the Sequence field like this:
SendMessage(OnUse,,Mariah)@3
The "3" at the end tells the sequence to wait 3 seconds before sending "OnUse" to Mariah.
On Jenny, make sure the bark UI's Duration field is set to 3 seconds (or however long you want the bark to stay onscreen).
For an easier workflow, you may prefer to use a bark conversation like in the Bark Conversation example. But both ways work; they each have their pro's and con's.
trouble with two npc sequential barks
Posted: Tue Mar 03, 2015 6:13 pm
by njg
I made sure I had both those items as suggested, they were and there was no change. Just to see if there was any change I added a third person Henry to the conversation, so it goes like this now.
mariah displays her line properly
jenny now displays her line properly
mariah displays her line properly
henry blips his line in and out in under a second
mariah displays her last line properly.
----
Somehow I have things set up so that the last person in the chain doesn't work as advertised and I can't see why as it is set up the same way as the rest of them.
The included 3bark example works perfectly by the way.
Nick
trouble with two npc sequential barks
Posted: Wed Mar 04, 2015 2:46 am
by Tony Li
Nick,
Can you send an example project to tony (at) pixelcrushers.com? Exporting it as a unitypackage works best.
If that's not possible, can you post screenshots of these:
Inspector for Henry's dialogue entry and the entries immediate before and after.
Inspector for Henry's and Mariah's bark UIs and BarkOnDialogueEvent triggers.
trouble with two npc sequential barks
Posted: Thu Mar 05, 2015 7:05 am
by Tony Li
For future readers, this was the issue:
By default, the Unity GUI Bark UI does a raycast check to make sure the bark will be visible to the player's camera. If there's an obstacle between the NPC and the camera, it hides the bark. You can disable this behavior by unticking Check If Player Visible.
It raycasts from the bark position to the player camera position. By default, the bark position is above the character's collider. If there's no collider, it raycasts from (0,0,0), which is usually the character's feet. You can customize the position by adding a UnityBarkUIOnGUI component.
In this case, the characters didn't have colliders yet, so it was raycasting from their feet, and the bumpy terrain was blocking the raycast.
The other GUI systems also work fairly similarly to what's described above.