Calculate On Your Platform

Learning C# as I wish to do game development using Unity. I’ve started a Windows Forms Application using C# so I can output the result, as I’m not familiar with how to output it any other way. I come from a Visual Basic background.

double Result;
Result = Math.Pow(2, 24);
lblResult.Text = Result.ToString();

I could also do this using

lblResult.Text = Math.Pow(2,24).ToString();

Hi there,

You can use debug.log.
Here is all the information you need:

Kind regards,
Lisa

Thank you for that bit of information. I saw the instructor using it afterwards.

I tried it myself, however when I go into Unity, add a scene called Power, add a C# script and call it Power, and then enter the same code as the instructor, it doesn’t print anything when I run the project. Currently trying to figure out what’s going wrong…

Try to figure that out, and if it doesn’t workout, please share your code here so we can help you.

I found the issue. The script wasn’t attached to anything, so it wasn’t executing. I created a plane and then dragged the script onto it, which made it run.

Very very new to Unity :slight_smile:

1 Like

Privacy & Terms