Page 1 of 2
Stop dialogue box flipping horizontally with characters
Posted: Thu Jul 04, 2019 5:54 pm
by lostmushroom
I have a small problem that I can't figure out. When characters (player or NPCs) are horizontally flipped, their dialogue boxes flip with them, meaning the text is unreadable without a mirror
Is there an easy way to fix this?
I'm using Corgi with the Night in the Woods style overhead bubbles.
Re: Stop dialogue box flipping horizontally with characters
Posted: Thu Jul 04, 2019 6:31 pm
by Tony Li
Hi,
Add an Always Face Camera component. You may need to tick the Rotate 180 checkbox.
Re: Stop dialogue box flipping horizontally with characters
Posted: Fri Jul 05, 2019 2:50 pm
by lostmushroom
Hi - to which asset should I add Always Face Camera?
Re: Stop dialogue box flipping horizontally with characters
Posted: Fri Jul 05, 2019 3:06 pm
by Tony Li
Hi,
Add it to the bubble UI.
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 9:30 am
by lostmushroom
Hey, sorry for the late reply. I didn't manage to get this working. I added the Always Face Camera component to the Speech Bubble Dialogue UI prefab and tried it with both Rotate 180 on and off. Also tried adding it to Bubble Template Menu Panel and Bubble Template Subtitle Panel. The dialogue boxes still flip with the characters.
Is there anything I might have missed?
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 9:52 am
by Tony Li
Since you're using Corgi, can you
untick Flip Model On Direction Change and tick Rotate Model On Direction Change?
The AlwaysFaceCamera script works with rotation, not negative scaling.
Alternatively, if you want to stick with Flip Model On Direction Change, you can add a small script to the ConversationZone child GameObject, something like this:
ConversationZoneMatchCharacterTransform.cs
Code: Select all
using MoreMountains.CorgiEngine;
using UnityEngine;
public class ConversationZoneMatchCharacterTransform : MonoBehaviour
{
Transform characterTransform;
void Start()
{
characterTransform = GetComponentInParent<Character>().transform;
}
void Update()
{
transform.localScale = characterTransform.localScale;
}
}
In fact, I'll add this script to the Corgi integration package.
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 10:25 am
by lostmushroom
Thanks for the script. I added it to the Conversation Zone prefab and it works for the NPCs, so that's great
Would it also work on the player character? My player prefab doesn't have a Conversation Zone, only a Player Menu Panel.
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 10:34 am
by Tony Li
Yes, you can use it for anything that has a Character component in a parent object
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 10:46 am
by lostmushroom
Applying it to the child objects of the Player prefab gives some scaling issues. I tried adding it to the PlayerMenuPanel and it makes the dialogue box massive. Makes sense that that would happen, but is there a workaround to get it working on the player?
Re: Stop dialogue box flipping horizontally with characters
Posted: Sun Jul 21, 2019 11:53 am
by Tony Li
Hi,
I just put the latest Corgi Support package on the
Extras page. (
direct download)
The script is named MatchCharacterDirection. It handles scaling properly with Flip On Direction Change or Rotate On Direction Change.