Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to force AR Foundation to maintain "up" when spawning a prefab on an image target?

Discussion in 'AR' started by vice39, Mar 13, 2021.

  1. vice39

    vice39

    Joined:
    Nov 11, 2016
    Posts:
    108
    Does anyone know how to force AR Foundation to spawn an object on an image target without changing it's orientation?

    Explanation: I have a prefab of a bowl of physics-enabled balls. When AR Foundation spawns it, the orientation is random and all the balls fall off.

    Vuforia has an option to do this, but I can't find something similar in AR Foundation.

    Sample video:
    https://www.dropbox.com/s/eb6mal0mkkti690/balls.mp4?dl=0
     
  2. Alexis-Dev

    Alexis-Dev

    Joined:
    Apr 16, 2019
    Posts:
    121
    Hi,

    Create a script to spawn your object with rotation = Vector3.Zero

    Best,
    Alexis