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

How getting the angle relatively to a plan which passes through the object's center?

Discussion in 'Scripting' started by danielapix, Mar 4, 2015.

  1. danielapix

    danielapix

    Joined:
    Feb 15, 2015
    Posts:
    7
    I want to translate an object along it’s symmetrical axis. I think of moving it defining the three world coordination axis considering the angle respecting to a virtual plane that passes through the object’s center. I have got some ideas; for example I would like calculating the sine and cosine of the angle, getting the local direction for the translation method. But to do that, I need the angle. Given that this script must work on 15-20 object spawned in the scene, I need something to get it with less calculation possible. So I’m asking if there is a method that returns it or a common way to get it with less calculations possible, because of the material to examine is so much and I have found nothing else the Vector3. Angle and Quaternion.Angle, that create me lots of problems. Unfortunately I’m a beginner and I don’t know unity a lot.

    These objects are clones of a prefab that have got different and random coorinates.
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Vector3.Reflect?
     
  3. danielapix

    danielapix

    Joined:
    Feb 15, 2015
    Posts:
    7
    How?