Prompts allow you to send players questions while they're in the context. This is great to check how they felt about different levels, objectives, and enemies.
If your game needs to lock the cursor or keyboard, use the beforePopup and afterPopup overloads on GamebuildFeedback.Prompt
Interested in suggesting features? We'd love to hear from you. Jump on our Discord to vote on our next features.
Last updated
//Make sure you add the namespace
using Gamebuild.Feedback;
// Called at the end of a boss fight
void OnBossFightEnd()
{
//Prompt
GamebuildFeedback.Prompt("How did you find that boss fight?",
GamebuildFeedback.QuestionType.Reaction, true);
}
//Simple way to ask for feedback
public class ExampleUsage : MonoBehaviour
{
void OnLevelEnd()
{
GamebuildFeedback.Prompt("How was the last level?", GamebuildFeedback.QuestionType.Linear, true);
}
}
//Add additional context to your player's feedback
public class ExampleUsage : MonoBehaviour
{
string playerHealth;
void OnLevelEnd()
{
List<string> additionalFeedback= new List<string> { "Level 1", playerHealth};
GamebuildFeedback.Prompt("How did you find the enemies?", GamebuildFeedback.QuestionType.Linear, true, feedbackOptions);
}
}
// If you need to unlock and lock your cursor when a player is giving feedback use the
// beforePopup and afterPopup overload.
public class ExampleUsage : MonoBehaviour
{
void OnLevelEnd()
{
Action beforePopup = () => Debug.Log("Preparing to show popup...");
Action afterPopup = () => Debug.Log("Popup closed.");
GamebuildFeedback.Prompt("What type of level would you like to see next?", GamebuildFeedback.QuestionType.Linear, true, beforePopup, afterPopup);
}
}