Saturday, May 11, 2019

unity - not all code paths return a value


I created a method in my spawn manager trying to get the maximum and minimum with of spawn to be within the screen but i keep on getting the error



error CS0161: `SpawnManager.GetRandomPointOnScreen()': not all code paths return a value



does anyone have an idea as to what might be causing this error


 Vector3 GetRandomPointOnScreen()

{

Camera camera = Camera.main;
float halfHeight = camera.orthographicSize;
float halfWidth = camera.aspect * halfHeight;

float horizontalMin = -halfWidth;
float horizontalMax = halfWidth;



}


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...