; expected but there is a ; there, what's the problem?

public Node GetNodeFromWorldPosition(Vector3 wp)
        {
            int x + Mathf.RoundToInt(wp.x / scaleXZ);
            int y + Mathf.RoundToInt(wp.y / scaleY);
            int z + Mathf.RoundToInt(wp.z / scaleXZ);

            return GetNode(x,y,z);
        }

int x + Mathf.RoundToInt(wp.x / scaleXZ); (; expected)
int y + Mathf.RoundToInt(wp.y / scaleY); (; expected)
int z + Mathf.RoundToInt(wp.z / scaleXZ); (; expected)

what am I missing?

Hi

You are missing a =

I assume your intent was:

public Node GetNodeFromWorldPosition(Vector3 wp)
        {
            int x = Mathf.RoundToInt(wp.x / scaleXZ);
            int y = Mathf.RoundToInt(wp.y / scaleY);
            int z = Mathf.RoundToInt(wp.z / scaleXZ);
            return GetNode(x,y,z);
        }

Adriano

1 Like