I have been playing around with sequences and have run into an issue with the Camera Angles. In the "Cam Angles" tab, I set my angle correctly for a close up shot of my character's head. But when the LUA sequence fires off in the game, the camera is set to a different position. The camera is placed in some scaled or offset position from where I set it up. I actually managed to see my character in the repositioned camera (just by moving the reference object and hitting play over an over and just happened to hit a position where my character is visible), but now, when my character moves and I kick off the sequence again, the camera goes back to the exact same world position instead of being offset along with my character and being relative to my character.
I really need some help here, at this point the cutscene sequences are unusable.
The setup is really basic and there isn't much going on in my game yet. Just an active camera and a secondary camera I use for the sequences.
Any idea why running this LUA in a sequence: Camera(CharCloseup,Character1); would not be positioning the camera relative to the Character1 Gameobject and instead would be positioned using world coordinates? The view when I look in the "Cam Angles" tab is correct but it doesn't seem to translate properly in game.
Camera not repositioning correctly
Re: Camera not repositioning correctly
Hi,
If CharCloseup is a loose GameObject in your scene, the Camera() sequencer command will move the camera to its exact world position.
If CharCloseup is a child GameObject underneath the GameObject or prefab that you've assigned to the Dialogue Manager's Display Settings > Camera Settings > Camera Angles field, it will determine CharCloseup's offset from its parent. Then it will position the camera at this offset from the subject (e.g., Character1). You can see an example picture here:
This assumes you've assigned to the Dialogue Manager's Camera Angles field a GameObject structure something like this:
If that doesn't help, please let me know. If you can post a screenshot that would help. Or also feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look.
If CharCloseup is a loose GameObject in your scene, the Camera() sequencer command will move the camera to its exact world position.
If CharCloseup is a child GameObject underneath the GameObject or prefab that you've assigned to the Dialogue Manager's Display Settings > Camera Settings > Camera Angles field, it will determine CharCloseup's offset from its parent. Then it will position the camera at this offset from the subject (e.g., Character1). You can see an example picture here:
This assumes you've assigned to the Dialogue Manager's Camera Angles field a GameObject structure something like this:
- Camera Angles [parent object]
- Closeup - local position: (0,2,1)
If that doesn't help, please let me know. If you can post a screenshot that would help. Or also feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look.
Re: Camera not repositioning correctly
Ok,
But that means then that common camera angles for characters of the same height need to be uniquely named and then duplicated under each character you use in your cutscenes... that seems strange but I guess necessary.
I did what you said and parented the angles to the characters and it seems to work... (so long as the Camera Angles parent object is at 0,0,0 offset from the character)
One other question:
In the demo the camera animates to the camera angle. In my project, the camera flips immediately to the new angle. Are there examples of Lua code that will make the camera fly to each new location over time?
Also, My main camera is a static angle and sometimes I would like to start the camera animation by matching the position of the other camera in my scene. Is it possible to match one camera to another in Lua code?
Thanks for all your help so far! great response time!
But that means then that common camera angles for characters of the same height need to be uniquely named and then duplicated under each character you use in your cutscenes... that seems strange but I guess necessary.
I did what you said and parented the angles to the characters and it seems to work... (so long as the Camera Angles parent object is at 0,0,0 offset from the character)
One other question:
In the demo the camera animates to the camera angle. In my project, the camera flips immediately to the new angle. Are there examples of Lua code that will make the camera fly to each new location over time?
Also, My main camera is a static angle and sometimes I would like to start the camera animation by matching the position of the other camera in my scene. Is it possible to match one camera to another in Lua code?
Thanks for all your help so far! great response time!
Re: Camera not repositioning correctly
If you set up your common camera angles as children of your camera angles prefab/GameObject, you can re-use them for all characters of the same height. They don't need to be unique. The Feature Demo scene is an example. Since the Dialogue Manager's Camera Settings > Camera Angles field is unassigned, it uses the default camera angles prefab located in Assets > Dialogue System > Prefabs > Camera Angles > Resources. Private Hart's conversation uses angles such as "Closeup" and "Medium Right", which are children of this prefab.protemus wrote:But that means then that common camera angles for characters of the same height need to be uniquely named and then duplicated under each character you use in your cutscenes... that seems strange but I guess necessary.
If you were to add another NPC somewhere else in the scene, you could use those same camera angles. Since they're children of the camera angles prefab, the offsets will apply relative to whichever NPC they're focusing on.
If a character has a different height, such as a child or a small critter, you'll want to define a new camera angle. The video tutorial has an example starting at 02:52.
As the third parameter, provide the duration over which you'd like it to fly. For example:protemus wrote:In the demo the camera animates to the camera angle. In my project, the camera flips immediately to the new angle. Are there examples of Lua code that will make the camera fly to each new location over time?
Code: Select all
Camera(CharCloseup, Character1, 2.5)
Another thing to note: If your sequence has multiple sequencer commands, each one will try to run immediately unless you've specified a time to start using the "@" format. For example:
Code: Select all
Camera(CharCloseup, speaker, 2.5);
Camera(Wide, speaker, 0.5)@3.5;
AnimatorPlay(Explode)@5.0
(BTW, these are sequencer commands, not Lua code. Think of sequencer commands as things that typically change visible stuff, whereas Lua code changes data such as internal dialogue database variables and quest states.)
If your moving camera is assigned to the Dialogue Manager's Camera Settings > Sequencer Camera, it should automatically start at your main camera's position when the conversation/sequence starts. If it doesn't, check that your main camera is actually tagged MainCamera. To move the sequencer camera back to the original position, use the 'original' keyword:protemus wrote:Also, My main camera is a static angle and sometimes I would like to start the camera animation by matching the position of the other camera in my scene. Is it possible to match one camera to another in Lua code?
Code: Select all
Camera(original)
Re: Camera not repositioning correctly
Wow thanks! That got me where I want to be.
Is there a list of sequencer commands or the ability to add more via C# script?
Is there a list of sequencer commands or the ability to add more via C# script?
Re: Camera not repositioning correctly
Yes to both!protemus wrote:Is there a list of sequencer commands or the ability to add more via C# script?
Third party support packages also have their own sequencer commands. For example, the Cinema Director Support package adds a command to kick off a Cinema Director cutscene, the NJG MiniMap Support package adds commands to show items on the minimap, etc.