Search Unity

Placing objects in the sky

Discussion in 'ARCore' started by cgeye, Jan 3, 2018.

  1. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    36
    Hi all,

    I'm having trouble getting a model aircraft to appear as if it's in the sky. No matter where I set the vertical height of the prefab it always displays on the ground when I build and run. It actually places me inside the model, whereas I want it to appear to be about 1500 Metres high. Anybody help me on this?
     
  2. reedny

    reedny

    Joined:
    Mar 4, 2017
    Posts:
    56
    Put a Debug.Log statement in your Update() method and print the transform.position of the game object (your prefab). If it is (0, 0, 0) then indeed it is at the same place as your camera (you). Otherwise if it is where you expect then something else is causing that.
     
  3. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    36
    Actually, I found the easiest way was to nest my gameobject inside an Empty gameobject, then offset it within the parent. Dead easy!
     
    HenryAsh likes this.