Access Character Position

CyberDev

New member
Hi,

I am new to Unity and want to have a script that will read the current location of the player.
Can I get a basic example script?

Thanks.
 
OK, Let me clarify.

I have found some references to a Game Manager that stores basic player information in the forums.

Example "Vector3 currentPosition = GameManager.instance.player.transform.position;"

I have been trying to find documentation to show me how to access it. Because your setup manager creates a "Game" object that is a manager, I thought there was a bit of code that would access the data I wanted and I was missing something.

After another hour searching the forums I think these GameManagers are created by individual developers and are not part of the Asset package.

Do you have a basic function for passing the current player location?

Thanks for your time.
 
You already have the code.

Create a new file, name it GameManager.cs and attach it to Nolan. In the Start method use print(transform.position).

There are tons of resources about learning C#, I would recommend spending several weeks or months learning C#.
 
Top