Search Unity

Instantiate an object inside the sphere

Discussion in 'Scripting' started by nicklowkc1, Feb 28, 2019.

  1. nicklowkc1

    nicklowkc1

    Joined:
    Feb 27, 2019
    Posts:
    28
    I am making a find hidden object game using a 360 photo and the camera is inside the sphere. It’s a VR 360 photo game, and I can point around using a laser pointer. I want to instantiate an object when the user press the trigger button and the laser is pointing to the correct answer. I manage to get object instantiate on the position by using Instantiate function, however the rotation of the object is just simply the rotation of the model I created. I want to make it looks like attach to the sphere, which mean the rotation of the object has to be changed. However I don’t know the math calculation to do it. Any advice or example will be highly appreciated. Thank you.
     
  2. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
  3. nicklowkc1

    nicklowkc1

    Joined:
    Feb 27, 2019
    Posts:
    28
    Hi Kobaltic1, thank you for your reply. I will try to use LookAt function!