vector 2 (2 values from -1.1)



  • Physics2D. Raycast accepts vector2 to indicate the direction up to 0.1, down 0, -1 to right 1, 0, and left -1, 0 How can I transform it.Rotation.z in Vector2, to make the beam look the same place as the object, Vector2.down will always be driving the beam down, regardless of the turn of the object.



  • // перевод градуса в радиану
    float radian = transform.Rotation.z*Mathf.Deg2Rad;
    Vector2 vector = new Vector2(Mathf.Cos(radian), Mathf.Sin(radian));
    

    Without knowing the geometry of the circumference, you won't go far in the gheimde. What? SinCos and Pi I need to know.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2