Answers for "fps fire unity accurate"

C#
0

fps fire unity accurate

//declare a float value to control the spread factor. .02 is a good default
 public var spreadFactor : float = 0.02;
 var direction : Vector3 = transform.forward;
 direction.x += Random.Range(-spreadFactor, spreadFactor);
 direction.y += Random.Range(-spreadFactor, spreadFactor);
 direction.z += Random.Range(-spreadFactor, spreadFactor);
 if (Physics.Raycast (transform.position, direction, hit, distance)){
Posted by: Guest on April-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language