It depends on how you want to classify when dialogue as being run. You could automate this whenever a line of speech plays, but with pauses, animation etc that can go in between it's probably best to zoom in for the duration of the entire ActionList.
If you assign your dialogue-sequence ActionLists a special tag (e.g. "Dialogue"), then you can have a custom script control the camera zoom when such lists being and end.
Attach this script (AutoZoomCamera.cs) to the active GameCamera (not the MainCamera) and check its Inspector values. It assumes the Camera uses Orthographic Projection - otherwise it'll need to be tweaked to affect the Field Of View.
If you assign your dialogue-sequence ActionLists a special tag (e.g. "Dialogue"), then you can have a custom script control the camera zoom when such lists being and end.
Sorry, it's a little unclear:
1. What do you need to attach the tag to?
2. Which ActionLists command attaches a tag?
You are putting the Dialogue Tag ** on the **WRONG OBJECT **, you have to **TAG THE OBJECT WITH ACTIONLIST ON IT, it has a symbol on it's Gameobject in the Hierarchy!
Carefully watch my video, which object i'm clicking on. I even let it highlight.
Dialogue Tag ON the Actionlist Object
NOT the Hotspot Object!!!!!!!
Click on this field, and that SHOWS you the object where you have to put the tag
CLICK HERE ON THE NAME IN THAT FIELD, THEN IT SHOWS YOU
Like here, it has those two symbols on the side in your hierarchy, you're clicking the hotspot without the actionlist: OR HERE IN YOUR HIERARCHY WITH THE ACTIONLIST SYMBOL That is the Object where you put the Dialogue Tag!
snan, thanks a lot! https://streamable.com/a8r4rt
Everything works fine, but when the effect of selecting the "dialog box" appears, the zoom effect is disabled, please tell me, do I need to change the script itself or assign a tag somewhere else?
Please tell me Chris, is it possible to tweak the script a bit so that it keeps track of whether there is a branched choice in the dialog that did not turn off the approximation? https://streamable.com/a8r4rt
Found two problems, one of them with a selection list, (zoom moves away although there is a tag)
And the second one, with the exit from the naninovel asset, although goes into a dialogue with the tag https://streamable.com/a48kbx
The script works fine, but when you exit the NaniNovel asset back to the AC, the script does not turn off, maybe you can set some parameter to disable the script and return the camera? https://streamable.com/kag2oh
Comments
It depends on how you want to classify when dialogue as being run. You could automate this whenever a line of speech plays, but with pauses, animation etc that can go in between it's probably best to zoom in for the duration of the entire ActionList.
If you assign your dialogue-sequence ActionLists a special tag (e.g. "Dialogue"), then you can have a custom script control the camera zoom when such lists being and end.
An object's Tag can be set to the left of its Layer - see Unity's docs on this here:
https://docs.unity3d.com/Manual/Tags.html
Attach this script (AutoZoomCamera.cs) to the active GameCamera (not the MainCamera) and check its Inspector values. It assumes the Camera uses Orthographic Projection - otherwise it'll need to be tweaked to affect the Field Of View.
Sorry, it's a little unclear:
1. What do you need to attach the tag to?
2. Which ActionLists command attaches a tag?
Set the tag to the GameObject of any ActionList that you want the camera to be zoomed in while playing.
https://streamable.com/2mo9jx
If I change the layer by adding a tag but the game does not see the character, tell me how to fix it correctly?
Set the Tag - not the Layer. These are two separate properties.
Tags are set to the left of the Layer field - again, see Unity's docs here:
https://docs.unity3d.com/Manual/Tags.html
Sorry, I mixed up layers and tags, I'm still learning to be a unity master
I installed the tag, but did not see the result, what else can I check?
Tag the ActionList that you wish to zoom in while running - not the character.
How do I tag "ActionList" if it's inside a character? Or I didn't get you, sorry.
Tag the GameObject of the Interaction - nothing to do with the NPC's GameObject or Inspector.
Please show a screenshot of what I should do, otherwise I'm completely confused. Excuse me.
Here you go bro
https://streamable.com/7dxdrd
I changed it a bit and it works nice for First Person too, thanks chris.
If anyone sees this later and wants it for a First Person Camera, just change any of the _camera.orthographicSize; to _camera.fieldOfView
https://streamable.com/f88ayr
The script most likely works on the camera does not affect anything, what am I doing wrong?
snan p.s.: thx!
You are putting the Dialogue Tag ** on the **WRONG OBJECT **, you have to **TAG THE OBJECT WITH ACTIONLIST ON IT, it has a symbol on it's Gameobject in the Hierarchy!
Carefully watch my video, which object i'm clicking on. I even let it highlight.
Dialogue Tag ON the Actionlist Object
NOT the Hotspot Object!!!!!!!
Click on this field, and that SHOWS you the object where you have to put the tag

CLICK HERE ON THE NAME IN THAT FIELD, THEN IT SHOWS YOU
Like here, it has those two symbols on the side in your hierarchy, you're clicking the hotspot without the actionlist:

OR HERE IN YOUR HIERARCHY WITH THE ACTIONLIST SYMBOL That is the Object where you put the Dialogue Tag!
snan, thanks a lot!
https://streamable.com/a8r4rt
Everything works fine, but when the effect of selecting the "dialog box" appears, the zoom effect is disabled, please tell me, do I need to change the script itself or assign a tag somewhere else?
Please tell me Chris, is it possible to tweak the script a bit so that it keeps track of whether there is a branched choice in the dialog that did not turn off the approximation?
https://streamable.com/a8r4rt
Found two problems, one of them with a selection list, (zoom moves away although there is a tag)
And the second one, with the exit from the naninovel asset, although goes into a dialogue with the tag
https://streamable.com/a48kbx
Tell me what can be done here?
The script only reads the tag for ActionLists - not Conversations.
To have the camera be zoomed in while Dialogue Options are displayed, the script must be amended:
The script works fine, but when you exit the NaniNovel asset back to the AC, the script does not turn off, maybe you can set some parameter to disable the script and return the camera?
https://streamable.com/kag2oh
The Object: Call event Action can be used to disable the script at runtime, disabling its influence.
And what exactly should be specified in the shutdown?
the path to the script or some kind of event?