Stop dialogue box flipping horizontally with characters
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Stop dialogue box flipping horizontally with characters
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.
I'm using Corgi with the Night in the Woods style overhead bubbles.
Re: Stop dialogue box flipping horizontally with characters
Hi,
Add an Always Face Camera component. You may need to tick the Rotate 180 checkbox.
Add an Always Face Camera component. You may need to tick the Rotate 180 checkbox.
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Stop dialogue box flipping horizontally with characters
Hi - to which asset should I add Always Face Camera?
Re: Stop dialogue box flipping horizontally with characters
Hi,
Add it to the bubble UI.
Add it to the bubble UI.
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Stop dialogue box flipping horizontally with characters
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?
Is there anything I might have missed?
Re: Stop dialogue box flipping horizontally with characters
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
In fact, I'll add this script to the Corgi integration package.
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;
}
}
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Stop dialogue box flipping horizontally with characters
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.
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
Yes, you can use it for anything that has a Character component in a parent object
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Stop dialogue box flipping horizontally with characters
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
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.
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.