Unity Beginner Questions

I am having Unity Free Edition and have some problems with figuring out how to get things to work.
I spent a fair ammount of time with Unity now but I am asking you for help.

My questions are:

  1. how to make the Escape key on the keyboard to quit a Unity game

  2. how to hide the mouse cursor in a Unity game

  3. how to create a second splash screen after the Unity splash screen

kind regards

Nik

The Unity docs are a great first port of call for questions like this, the scripting guide is particularly good since it’s searchable.

  1. Application.Quit

  2. Screen.showCursor

  3. For a splash screen, make an extra scene with some GUI elements and a script that automatically loads your next scene after a set amount of time. (and maybe handle the fade up/fade down stuff)

Thanks :slight_smile:

OK

where do I write it in?

sorry for my silly question :?

The code to quit your application needs to go in an Update() function. (so you check if esc is being pressed every frame)

Hiding the mouse cursor could be done in a Start() function if you want to do it at the beginning and leave it that way.

The code to advance off your splash screen should just go in a script running in the splash screen scene.

If you’re not familiar with scripting in Unity, you might be better off working your way through a tutorial before you head off on your own - they cover a lot of great stuff.

Hey, Thanks so much :slight_smile:

I waded my way through with your help to get the two scripts running (Escape key and Mouse Cursor)

The scripts structure however does NOT make sense to me…

In my opinion it would make sense to me that if there was a script named “game logic” or something.

That will take me a long time to get used to that and UNDERSTAND it.

It’s my first ever game engine I get my hands dirty on… Everything new… Lots of stupid questions

my apologies for being so incompetent

kind regards
Nik

It can take a while to get your head around Unity, especially if you’re familiar with other workflows.

Its easiest to think of everything being component based with scripts just being another component. So you might make an enemy that’s controlled by a script then dump ten instances of them in the level, the player might have a movement script, and if you have stuff that needs to run above the game, you can always create an empty game object called “GameManager” and stick a game manager script on that.

That’s why I recommended checking out the tutorials - even if you just download a PDF or two and read through it without performing the steps, it’ll probably give you a more complete overview of how Unity works than trying to hammer things out on your own.

Thanks for your advise.
Your help is highly appreciated.

Nik

If you have not done so already then please start your Unity life by working through the tutorials we have on our website. If you just jump in first then you’re going to find things a little strange but only based on not knowing any better. :stuck_out_tongue:

We have a lot of resources posted online for folks to learn from:

Unity: Resources

In specific take a look at the first-person shooter tutorial and then the 3D platform game tutorial:

FPS Tutorial
3D Platform Game Tutorial

Both of those will walk you through the basics of Unity. From use of the editor to art pipeline work to script writing to physics to character animation blah blah blah…

So, read the learning materials, get comfortable and you’ll soon enough have a grip on how Unity works and be making some cool stuff!

Hey Thanks :slight_smile:

I will sure read through it.
FPS games… haha…yeah…
well, actually I’m after making a racing car game.
will take a while for you guys to see the skidmarks of the game I’m after… LOL

Nik

I absolutely agree, you HAVE TO follow the 2D and then 3D tutorials to get into the Unity mindset; if you don’t understand how to do things in Unity, you won’t be able to do anything at all.

Taking the time to READ and follow though those tutorials (and keep the Unity Reference manual open in a 2nd window while you’re working) will save you a lot of time and questions.

Have fun!

-Will