Page 1 of 1
Look At() for 2D
Posted: Sat Jan 22, 2022 5:40 pm
by roxos
Hi all! In my 2D game I would like to use the LookAt() sequencer command. But the problem is that it doesn't turn the NPC all the way around (the character rotates the Y-axis by 90 and hides from view. When in fact he should be rotating 180). Haven't found how to fix this, is it possible?
Re: Look At() for 2D
Posted: Sat Jan 22, 2022 8:21 pm
by Tony Li
Hi,
LookAt() works in 3D by rotating the subject's transform so its forward direction faces the target.
In 2D, you can write a custom sequencer command (
tutorial). There's no built-in command for 2D because direction in 2D varies quite a lot. Some projects rotate the sprite. Others set localScale.x to +1 or -1. Others set the SpriteRenderer's flipX value.
Re: Look At() for 2D
Posted: Sun Jan 23, 2022 8:59 pm
by roxos
Hello Tony and Thanks!
Can you tell me: is there any way to organize and group conversations in the dialog system? And does a large number of conversations affect performance (e.g. a lot of bark or small dialogs)?
Also, my game has a lot of variables (for dependencies in the story), do I need to group them?
Sorry for offtop
Re: Look At() for 2D
Posted: Sun Jan 23, 2022 9:19 pm
by Tony Li
Hi,
You can use forward slashes in conversation titles to group your conversations. For example, you could title your conversations:
- Companions/Robot Butler/At Your Service
- Companions/Robot Butler/Malfunction
- Desert/Scavenger
- Desert/Scorpion Herder
- Jungle/Shaman, etc.
This will group them into submenus "Companions", "Desert", and "Jungle" in the Dialogue Editor, making it much easier to select conversations. The "Companions" submenu will have a sub-submenu for "Robot Butler".
Note that Dialogue System Triggers refer to conversations by title. If you change a conversation's title, remember to update the Dialogue System Trigger.
For other dialogue database content -- actors, quests, and variables -- you can use the Dialogue System's Asset Renamer tool. This tool will rename something in your whole project, including dialogue databases, Dialogue System Triggers in scenes, etc. (The Asset Renamer will eventually handle conversation titles, too.)
I recommend grouping everything -- quests, variables, and conversations. Common grouping approaches are by area (e.g., Village, Dungeon, Temple) or by progress (e.g., Chapter01, Chapter02, etc.).
Re: Look At() for 2D
Posted: Sun Jan 23, 2022 10:39 pm
by roxos
How obligatory is it to specify an actor in the dialogue system? Is it necessary to create an actor for each character with whom my player is a conversation?
Re: Look At() for 2D
Posted: Mon Jan 24, 2022 8:49 am
by Tony Li
It's not mandatory. Some games just use the default "Player" and "NPC" actors for everything.
Please also see:
Character GameObject Assignments.