Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by phuakeyin · Feb 21, 2020 at 04:13 PM · guigamepopup

how to do a Popup window when the answer are correct

hello everyone! I am new to unity. I am trying to make a simple 2D mobile based game using unity. Now i am stuck at when the play drag and drop all the box correctly, there will have a popup window to show the player that level is completed, can move to new level. i have been trying searched at website and did the coding by myself, but still can't work... Anyone can help me? Below is the coding for the player dragging the box:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class Manager : MonoBehaviour
 {
     public GameObject first, second, third, forth, first_black, second_black, third_black, forth_black;
 
     Vector2 firstInitialPos, secondInitialPos, thirdInitialPos, forthInitialPos;
 
     private void Start()
     {
         firstInitialPos = first.transform.position;
         secondInitialPos = second.transform.position;
         thirdInitialPos = third.transform.position;
         forthInitialPos = forth.transform.position; 
     }
 
     public void DragFirst()
     {
         first.transform.position = Input.mousePosition;
     }
 
     public void DragSecond()
     {
         second.transform.position = Input.mousePosition;
     }
 
     public void DragThird()
     {
         third.transform.position = Input.mousePosition;
     }
 
     public void DragForth()
     {
         forth.transform.position = Input.mousePosition;
     }
 
     public void DropFirst()
     {
         float Distance = Vector3.Distance(first.transform.position, first_black.transform.position);
         if(Distance<50)
         {
             first.transform.position = first_black.transform.position;
         }
         else
         {
             first.transform.position = firstInitialPos;
         }
     }
 
     public void DropSecond()
     {
         float Distance = Vector3.Distance(second.transform.position, second_black.transform.position);
         if (Distance < 50)
         {
             second.transform.position = second_black.transform.position;
         }
         else
         {
             second.transform.position = secondInitialPos;
         }
     }
 
     public void DropThird()
     {
         float Distance = Vector3.Distance(third.transform.position, third_black.transform.position);
         if (Distance < 50)
         {
             third.transform.position = third_black.transform.position;
         }
         else
         {
             third.transform.position = thirdInitialPos;
         }
     }
 
     public void DropForth()
     {
         float Distance = Vector3.Distance(forth.transform.position, forth_black.transform.position);
         if (Distance < 50)
         {
             forth.transform.position = forth_black.transform.position;
         }
         else
         {
             forth.transform.position = forthInitialPos;
         }
     }
 }

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tormentoarmagedoom · Feb 21, 2020 at 04:18 PM

Hello There. I dont understand what are you asking for exactly... Creating a popup window is so simple. You first need to create a new canvas and design the window. Then just need to SetActive() (true ir false) the object whne neccessary.

If not asking for this, please be more specyfic...

If you are asking for a whole code for popup, animationm scene change, etc... then remake the post asking ONLY one thing, multiple requests posts will be deleted.

Bye!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DonDior · Feb 14, 2021 at 12:16 AM 0
Share

I think I’m having the same problem, upon entering the correct answer on a quiz game I’d like to have a panel pop up where you’d have the next question button and also a “congratulations”/“well done” text. Hope that was a bit clearer, thanks.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

245 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make GUI pop up when you touch other gui 1 Answer

Make a pop up window work on a key press 1 Answer

What's a great way to make a custom information window pop up 1 Answer

ignore left mouse button click in the game when using gui buttons 4 Answers

Game Options In-game 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges