Hello, I'm having trouble with my proximity distance between my 2d player and NPC. You can see from at the top of the game screen that once I get in range of being able to start the interaction, it's flickering on/off. I do have a capsule collider 2d on both NPC and player, and I also use hitbox studio pro that creates hitboxes on the fly per animation, but these are not capsule colliders, just normal rectangles set to isTrigger = true.
Re: Help: Issue with 2d proximity.
Posted: Mon Apr 29, 2019 10:17 am
by Tony Li
Hi,
It's probably Hitbox Studio. Triggers can still register OnTriggerEnter2D events with other triggers. Can you move the Proximity Selector-related triggers to child GameObjects that are on their own layer? This way you can more precisely control OnTriggerEnter2D events.
Re: Help: Issue with 2d proximity.
Posted: Mon Apr 29, 2019 9:47 pm
by jnhasty7
worked like a charm Tony, thank you.
While you're here, I'm also having trouble with different NPC subtitle panels.
-I've copied over the NPC Subtitle Panel as a child under my NPC Game Object.
-I've added the NPC Subtitle Panel to the Stand Dialog UI Script (under subtitle panels).
-I've edited the new NPC Subtitle Panel to play sound for the typewriter.
-I've added a "Dialogue Actor" script and set the "Actor" to the Dialog Database that I'm using.
-Below that, I've set the NPC object.
-It actually works as a new Panel. It plays the sounds with the typewriter, but the portrait, NPC name, and subtitles (text) are not displaying as they were by using the default, it's just showing the (NPC Name) | (NPC Subtitle).
Re: Help: Issue with 2d proximity.
Posted: Mon Apr 29, 2019 9:54 pm
by Tony Li
Hi,
Since the new subtitle panel is no longer a child of the Standard Dialogue UI GameObject, it might be better to not assign it to the Standard Dialogue UI's subtitle panels list. This is because it could get disconnected if you change to a scene that doesn't contain the NPC. Instead, set the NPC's Dialogue Actor > Dialogue UI Settings > Subtitle Panel Number dropdown to Custom, and assign the new subtitle panel to the Custom Subtitle Panel field.
Then make sure that the fields are assigned correctly on the new subtitle panel's Standard UI Subtitle Panel component.
Re: Help: Issue with 2d proximity.
Posted: Mon Apr 29, 2019 10:17 pm
by jnhasty7
I've done what you said and taken it off the Basic Stand UI list, and I set it up as said above. It's still behaving the same way.
This is my object hierarchy
Re: Help: Issue with 2d proximity.
Posted: Mon Apr 29, 2019 10:31 pm
by Tony Li
Are the correct elements assigned to the NPC's Standard UI Subtitle Panel component?
Also, is it a child of a canvas? Unity UI elements need to be inside a canvas.
As a test, you can add an instance of the Bubble Subtitle Panel prefab to the NPC. This prefab has its own canvas. Set its canvas's layer so it's on top of your sprites to make it visible, and assign it to the Custom Subtitle Panel field. If it works, then look at your NPC's NPC Subtitle Panel.
Is it possible that one of the Dialogue Manager's Basic Standard Dialogue UI subtitle panels is still visible and overlapping the NPC's subtitle panel?
I'm finishing work for the evening, but I'll check back first thing in the morning.
Re: Help: Issue with 2d proximity.
Posted: Tue Apr 30, 2019 4:02 pm
by jnhasty7
I took your advice and played around with it.
I created a canvas object and put the "NPC Subtitle Panel" as its child.
Then I changed Standard UI Subtitle Panel (Script) > Visibility > Start State = Closed.