Beginner Help (415215)

I have been creating a project for College that lets users explore the solar system, I am a complete newbie to Unity and while I have muddled through with coding I have found, taken apart and rebuilt for my project I have had big problems with key elements. In Particular the GUI!

I have everything animated and working in this image, apart from the display in the bottom right, I would like to have the circle in the center display the planet that was last clicked on if it is possible to do so? Like I said I am a complete beginner and any help would be very much appreciated.

Thanks for your time :slight_smile:

Hi, welcome to the forum!

What you’re asking definitely sounds possible. If the planets are 3D objects in the scene, you can probably use an OnMouseDown function or raycasting to determine which one has been clicked, eg:-

var planetName: String;
   ...
   
// Left button.
if (Input.GetMouseButtonDown(0)) {
	var ray = Camera.main.ScreenPointToRay(Input.mousePosition);

	if (Physics.Raycast(ray, hit)) {
		planetName = hit.transform.name;
	}
}