I created a method that checks whether the value of a Vector3 has any zeros and if it does changes them to zero. Heres my code:
using UnityEngine;
using System.Collections;
public class CheckForZero : MonoBehaviour
{
public Vector3 Vectvalue;
// Use this for initialization
void Start ()
{
Vectvalue = new Vector3(0, 0, 0);
CheckValue(Vectvalue);
}
void CheckValue(Vector3 vect3)
{
if (vect3.x == 0)
vect3.x = 1;
if (vect3.y == 0)
vect3.y = 1;
if (vect3.z == 0)
vect3.z = 1;
}
}
The problem is that the value isn’t being assigned to the Vector. So my question is why is my vector3 value not changing?