Hi there,
Im trying to tidy up a bunch of IF statements and I cant think of a way passed it due to the greater than and less than symbols. If anyone could offer any suggestions would be great! Here is my code:
if (transform.position.x > groundSizeX)
{
transform.position = updateX(-groundSizeX);
}
if (transform.position.x < -groundSizeX)
{
transform.position = updateX(groundSizeX);
}
if (transform.position.z > groundSizeZ)
{
transform.position = updateZ(-groundSizeZ);
}
if (transform.position.z < -groundSizeZ)
{
transform.position = updateZ(groundSizeZ);
}