Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
How to ask runtime permissions for Camera in unity?

I need a C# script, in case the user refuses permission, a message appears that he must go to the settings in order to allow the permission the overloaded image here enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you try searching a bit on the Google or in Unity Docs, you'll find Requesting Permissions article. I would suggest you to go through the complete documentation to get the better idea.

However, to make things easy, you can refer to below code:

using UnityEngine;
#if UNITY_ANDROID
using UnityEngine.Android;
#endif

void CheckCameraPermission()
{
    #if UNITY_IOS
        if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
            // PERMISSION NOT AVAILABLE ON IOS, DISPLAY POPUP MESSAGE
        }
    #endif
    #if UNITY_ANDROID
        if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
            // PERMISSION NOT AVAILABLE ON ANDROID, DISPLAY POPUP MESSAGE
        }
    #endif
}

I hope that answers your question.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!