want to find out what side of die is pointing up

First Post to this forum, first attempt at C# & Unity so I appreciate any/all feedback. I am trying to create a dice game and want to determine which side of the rigidbody has the highest Y directional axes and return that face value. I currently get a warning sign saying unreachable code detected and do not have any value returned for my y axes.

here is my current code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ApplyForceInRandomDirection : MonoBehaviour {

public string buttonName = "Fire1";
public float forceAmount = 10.0f;
public ForceMode forceMode;
public Rigidbody rb;
public float torqueAmount = 10.0f;
public Vector3 dieDirection;

void Start() 
{
	rb = GetComponent<Rigidbody>();
	dieDirection = rb.transform.TransformDirection(0,0,0);
}	
// Update is called once per frame
void Update () {

	
	if (Input.GetButtonDown (buttonName)) {
		rb.AddForce (Random.onUnitSphere*forceAmount, forceMode);
		rb.AddTorque (Random.onUnitSphere*torqueAmount, forceMode);
	}
}
public Vector3 GetDirection(float x, float y, float z){
	return transform.TransformDirection (dieDirection);
	print (y);
}

}

With the dice, you should work with a random rotation and drop the dice from maybe 5 Unity units height onto a flat surface. In the real world, you let the dice drop from a certain height on e.g. a table. So it’s best to copy this into the game world:

public GameObject dice;
public Vector3 dropLocation = new Vector3(0, 5, 0);
public float tumble = 5f;

public void RandomRotator()
{
  dice.transform = dropLocation;
  RigidBody rb = this.GetComponent<RigidBody>();
  rb.angularVelocity = Random.insideUnitSphere * tumble;
}

You can call this e.g. from a button and let Physics do the rest.

Afterwards, you can check the angles on the transform. A rotation of -90 and 90 on X would be the first two sides, -90 and 90 on the Z would be the other two, 0 and -180 on the Y would be the last two sides…

Your “unreachable code” is what you wrote after “return”. Return can be used to end functions prematurely (e.g. "if (gameOver) { return; }; ). In this case, it ends the function before you call “print”.