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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Transform.eulerAngles - Vector2?

Discussion in 'Scripting' started by topofsteel, Apr 6, 2015.

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I'm trying to get a small piece of code someone posted to work. The code is using eulerAngles as a vector2. But the documentation values have it as a vector3. Have I missed something?

    Code (CSharp):
    1.    
    2. // Calling code
    3.     TeleportPlayer(StartPosition.transform.position, StartPosition.transform.eulerAngles);
    4.  
    5. // Method to move
    6.     public void TeleportPlayer(Vector3 position, Vector2 eulerAngles)
    7.     {
    8.         //vp_FPController
    9.         _FPController.SetPosition(position);
    10.         // vp_FPCamera
    11.         _FPCamera.SetRotation(eulerAngles);
    12.     }
    http://docs.unity3d.com/ScriptReference/Transform-eulerAngles.html
     
  2. TRG96

    TRG96

    Joined:
    Mar 26, 2011
    Posts:
    102
    Post the code for the function "_FPCamera.SetRotation(eulerAngles);"
    Im pretty sure euler angles always have an x,y and z component.