Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

PowerQuest

A Nifty 2D Adventure Toolkit for Unity · By Powerhoof

Wrong text position upon entering room

A topic by AlexTzanop created Jul 26, 2021 Views: 136 Replies: 1
Viewing posts 1 to 2

Hi there!

I'm facing some problems with the characters' text position when entering a room.

Say I enter a new room and I start  a cutscene. Sometimes, the very first text will be in a random position and not on top of the character speaking(changing the TextPositionOverride didn't seem to do anythin).  All other texts are positioned as expected.

For example, I might have something like this:

IEnumerator OnEnterRoomAfterFade(){
    E.StartCutscene();
    yield return C.Character1.Say("blah blab blah") //this text appears in a random position
    yield return C.Character1.Say("more blah") //this is positioned correctly
    E.EndCutscene();
} 

Any ideas on what could be wrong?


I also have some secondary questions:

1) Sometimes I'd want a character to be talking in the background when entering a scene. I've noticed that if the character is off-screen, the text will appear on the edge of the screen. The problem is that when approaching the character, the text will stay in place and eventually appear as if it's floating.
Is there a built-in way to have the text stay on the edge of the screen while moving, and eventually rest on top of the character speaking when said character appears on the screen?

2)Having a character off-screen, is there a way to make their text not appear on the edge of the camera(making the text also off-screen).

Sorry for the long post, and thank you in advance!

~Alex

Hrmm. I'm not seeing the same thing when I do some tests. It might be a subtle difference in versions of unity (I'm testing in 2018.4). Maybe simple fix for now is just adding a pause before the dialog (The scene will still be fading in anyway). Easiest is just a `..` line for a 0.25f sec pause.

As for 1), that's something I've been meaning to add, having text that stays with the character if they're moving. I'm going to want that in my own games too. It's not possible yet though.  As for 2) I think an option to disable/re-enable text for a specific character would be useful for background dialog, where you might want speech but no text. Again, that's a feature I'd need to add. If you don't have speech though, you could just check if their position is off-screen and not play the line if they are. eg

if ( Mathf.Abs(C.Dave.Position.x - Camera.Position.x) < 160 )
{
    C.Dave.SayBG("Some random background dialog");
}