Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:06:33+00:00 2026-06-11T15:06:33+00:00

I am using unity and vuforia for Android to create an AR app (project).

  • 0

I am using unity and vuforia for Android to create an AR app (project). I have a 3d text and i want to change it’s position corresponding to user’s location.

Right now, i can get his location and updates and i can show it on a Gui label using OnGUI function.

The 3d Text is a prefab so do i have to instantiate it everytime the user gets to a new location?

The 3d Text should appear only once (depending his current location). That means, i have to destroy first, previous instantiated texts or will it be overriden?

Finally, where should i write the instantiation code? I mean, on the Update() function? Start()? so to be run only when location changes and not all the time.

I am currently getting familiar with Unity and i am trying to figure out how it works.
Ask me if you would like more information.

Thank you in advance for your time and answers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:06:34+00:00Added an answer on June 11, 2026 at 3:06 pm

    Depends on your project setup and there are probably other ways to do this but I would suggest hiding the 3D Text via the mesh renderer. In your code you want to check in the update function if there`s been a change in the location since the last update. How you go about this is by creating two variables: one for the users current position and one for the position at the previous update call. So the secret here is two functions: Update and LateUpdate.

    Here`s an example

    #pragma strict
    @script ExecuteInEditMode;
    
    var curPos : Vector3;
    var lastPos : Vector3;
    var timeToWait : float = 2.0;
    var shwoing : boolean;
    
    function Start()
    {
        ShowText(false);
    }
    
    function Update()
    {
        // check if our current position is the same as our last position
        if(lastPos != curPos && !showing)
        {
            ShowText(true);     // Show the 3d text
        }
    
        if(lastPos == curPos && showing)
        {
            ShowText(false);    // Don't show the text
        }
    }
    
    function LateUpdate()
    {
        lastPos = curPos;   // change our last Positon to our current position
    }
    
    function ShowText(state : boolean)
    {
        renderer.enabled = state;    // enable or disable the renderer
        showing = true;              // variable to tell to keep showing text
        yield WaitForSeconds(timeToWait);   // wait a few seconds before changing the state
        showing = false;             // tell update to not show text
    }
    

    Doing things this way you don’t have to face the headache of cleaning up your scene as you only have once instance of the 3DText to deal with. I hope this helps… it might need a lil bit of work but i gotta run now. Lemme know if you need me to explain a lil more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Unity (C#) to create an iOS and Android app that shall
Using Unity in an ASP.Net MVC 2 app I have various dependencies on Controllers
I've been using Unity for some time in my project. I have a singleton
I have set up an Unity 2.0.414.0 container using app config. My solution structure
I am trying to create a iOS and Android XMPP chat client using Unity/C#/Mono.
I am using Unity in my webapplication project. I also have other library project
I'm using Unity with an Asp.net MVC 3 app. Here is some code running
I have been using Unity for quite a while but I have always used
I have seen this line of code in several tutorials for using Unity in
I'd like to create an instance of a class using unity where the class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.