Skip to content

Instantly share code, notes, and snippets.

@SamatKadyrov
Last active November 30, 2023 18:01
Show Gist options
  • Save SamatKadyrov/c13e4f879bd6d51cf67d056db7d7deb6 to your computer and use it in GitHub Desktop.
Save SamatKadyrov/c13e4f879bd6d51cf67d056db7d7deb6 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class VectorOperations : MonoBehaviour
{
[SerializeField] private Vector3 _vectorA;
[SerializeField] private Vector3 _vectorB;
[SerializeField] private Vector3 _vectorC;
private Vector3 _side1;
private Vector3 _side2;
private Vector3 GetNormal(Vector3 _vectorA, Vector3 _vectorB, Vector3 _vectorC)
{
_side1 = _vectorB - _vectorA;
_side2 = _vectorC - _vectorA;
return Vector3.Cross(_side1, _side2).normalized;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment