Hi, I recently bought the Dialogue System and I'm using it for a Unity3d student project. I have a few questions:
Whenever I go interact with the NPC using the proximity selector script or any other selector script, the camera angle zooms out and stays in that angle even when the conversation has ended. Is there any way to fix this, or better yet, have it not use a camera angle altogether?
I tried looking at many tutorials and so far haven't seen anything that can help yet. Another thing I would like to know is how can one trigger an event when a player chooses an option from a dialogue, specifically setting a float variable from a different script to a different number.
Currently, the player character game object I have has a camera child and uses a smooth camera follow. However, the movement is done using a custom script and does not have mouse control that moves the camera yet (still learning how to!). If there are any other specific things you would like to know to better help me, feel free to ask!
Thank you
Stopping Camera Angles?
Re: Stopping Camera Angles?
Hi,
Thanks for buying the Dialogue System!
This will pause the subtitle for a duration proportional to the text length, without touching the camera.
If you end up using Camera() sequencer commands to control the camera during conversations at some point, you'll want to temporarily disable your smooth camera follow during the conversation to prevent it from fighting with the Dialogue System. Use the Set Component Enabled On Dialogue Event component to do this. You can read more about this in the How To Set Up The Player section. You can also use this component to temporarily prevent the player from moving around during conversations.
For example, say you have a script that keeps track of a value such as GPA:
Add a method to change gpa, and a couple methods to register it with the Dialogue System:
Then use the "SetGPA" function in a dialogue entry node:
Thanks for buying the Dialogue System!
Set the Dialogue Manager's Display Settings > Camera Settings > Default Sequence to: Delay({{end}})mellopillow wrote:Whenever I go interact with the NPC using the proximity selector script or any other selector script, the camera angle zooms out and stays in that angle even when the conversation has ended. Is there any way to fix this, or better yet, have it not use a camera angle altogether?
This will pause the subtitle for a duration proportional to the text length, without touching the camera.
If you end up using Camera() sequencer commands to control the camera during conversations at some point, you'll want to temporarily disable your smooth camera follow during the conversation to prevent it from fighting with the Dialogue System. Use the Set Component Enabled On Dialogue Event component to do this. You can read more about this in the How To Set Up The Player section. You can also use this component to temporarily prevent the player from moving around during conversations.
Register a C# method with the Lua environment, and then use it in a dialogue entry node's Script field.mellopillow wrote:Another thing I would like to know is how can one trigger an event when a player chooses an option from a dialogue, specifically setting a float variable from a different script to a different number.
For example, say you have a script that keeps track of a value such as GPA:
Code: Select all
public class GradePointAverage : MonoBehaviour {
public float gpa; //<--This is the player's current GPA.
}
Code: Select all
using PixelCrushers.DialogueSystem;
public class GradePointAverage : MonoBehaviour {
public float gpa; //<--This is the player's current GPA.
void OnEnable() {
Lua.RegisterFunction("SetGPA", this, typeof(GradePointAverage).GetMethod("SetGPA"));
}
void OnDisable() {
Lua.UnregisterFunction("SetGPA");
}
public void SetGPA(double value) { // Lua uses doubles.
return gpa = (float) value;
}
}
- Dialogue Text: "Great job! You get an A+."
- Script: SetGPA(4.0)
- Dialogue Text: "Would you like to join the Honors Program?"
- Script: GetGPA() >= 3.5
-
- Posts: 2
- Joined: Tue May 31, 2016 11:43 pm
Re: Stopping Camera Angles?
Thanks so much for the quick response! This helped quite a lot, although the camera problems were solved by putting the camera tag as MainCamera. The settings were already in those you specified in the response when it was having problems, but it was still helpful.
Thanks again for the Lua explanation and I'll be sure to ask if I have any other questions
Thanks again for the Lua explanation and I'll be sure to ask if I have any other questions
Re: Stopping Camera Angles?
Sounds good. Happy to help! (Although in the end you fixed it yourself. )