Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / PerpendicularVector.cs
@Rackday Rackday on 21 Aug 2024 550 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class PerpendicularVector : MonoBehaviour
  5. {
  6. [SerializeField]
  7. private Transform target;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. transform.LookAt(target);
  16. }
  17. public Vector3 WhalePerpendicular(bool negate)
  18. {
  19. if(!negate)
  20. return transform.right;
  21. else
  22. return -transform.right;
  23. }
  24. }