Search Unity

Move Camera with object

Discussion in 'AR' started by SmonSvk, Nov 30, 2018.

  1. SmonSvk

    SmonSvk

    Joined:
    Aug 16, 2016
    Posts:
    9
    Hello,

    Is there any sollution how move camera with object? If I have car in unity world with buildings and want to drive this car. But I want the car to stay in same position on anchor and the world will move around the car. Because the world is to big for AR.

    Thank you for any help.
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    If using ARFoundation, it sounds like you want to position the ARSessionOrigin in the driver's seat of the car. That would make the camera position relative to the car at all times.

    This sounds like an unusual use case for AR, though. Can you describe your application in more detail? How do you plan to have the physical environment affect or interact with the scene, for instance?
     
    satchell likes this.
  3. GammaSim

    GammaSim

    Joined:
    Nov 12, 2018
    Posts:
    1
    Hi all. I have the same question posted by SmonSvk. I want to, after scanning the environment with the camera, spawn a prefab. And i would want to know if i can attach the camera to this prefab, like a first or third person camera, and get the view of that prefab when it moves around the environment (like following him). Imagine to get the view of a place you are not focusing now with your mobile phone (but previously scanned), but watching it because that prefab moves there, with the camera attached. Sounds a bit weird, but maybe it is possible. Thank you so mucho in advance!