Skip to main content
added 3 characters in body
Source Link
jhocking
  • 15.8k
  • 2
  • 45
  • 59

Calculate the dot product to determine how close two vectors are. The dot product is 1 when they are exactly the same, -1 when they are exactly opposite, 0 when they are perpendicular, and decimal values when partway.

So take the current direction, the target direction, then Vector3.Dot() and check if lessgreater than .19 (or whatever threshold you decide looks good).

Calculate the dot product to determine how close two vectors are. The dot product is 1 when they are exactly the same, -1 when they are exactly opposite, 0 when they are perpendicular, and decimal values when partway.

So take the current direction, the target direction, then Vector3.Dot() and check if less than .1 (or whatever threshold you decide looks good).

Calculate the dot product to determine how close two vectors are. The dot product is 1 when they are exactly the same, -1 when they are exactly opposite, 0 when they are perpendicular, and decimal values when partway.

So take the current direction, the target direction, then Vector3.Dot() and check if greater than .9 (or whatever threshold you decide looks good).

Source Link
jhocking
  • 15.8k
  • 2
  • 45
  • 59

Calculate the dot product to determine how close two vectors are. The dot product is 1 when they are exactly the same, -1 when they are exactly opposite, 0 when they are perpendicular, and decimal values when partway.

So take the current direction, the target direction, then Vector3.Dot() and check if less than .1 (or whatever threshold you decide looks good).