checked the document I dont understand what GetSafeNormal does and when to use it ?
Checks if the vector length is greater than zero, then returns the vector with a length of 1 (also called direction vector / unit vector / normalized vector)
thanks, any usage example ?
E.g. if you need to calculate an angle between two vectors, you’ll have to get a dot product of them. For the dot product to be correct for angle calculation, both vectors must have the same length. Therefore you normalize both of them to have two vectors with the length of 1.
Or you have subtracted location of one actor from another, and you have a direction. You want to launch one actor towards the other, and you have to use that direction. However, the distance may be different each time, and you want the launch velocity to be the same every time, so you cant use the direction vector directly. So you normalize it and multiply it by a certain constant velocity value before launching.