Referencing current position

Hello.

Can anyone tell me how you would reference the current position of the avatar in order to pass this into an instantiate command? We are trying to spawn objects at the current location.

Cheers

maybe have a Vector3 variable, and then set it to the players transform.position

How do we specify the players transform.position?

//Have the variable at the top??

var playerPosition : Vector3;

and then how does the instantiate command pick up the players current position and feed this into the Vector3?

Thanks

well, it this is a script attached to the player, use something likeplayerPosition = transform.position; but if this script isnt attached to the player, then you can either set up a variable for the player (var player) or you can tag the player, and access the player through tags (gameObject.FindWithTag(“Player”).transform.position)

Thanks…

The object I’m trying to spwan is triggered by an OnGui so I only want 1 script for this. And I also have 6 cameras which can spawn the object depending upon which one is active. If I attach a spawn script to each camera and have the OnGui execute the spawn script would it run the script for the active camera only? If so how do I execute one script from another?

Many thanks… you may have gathered that scripting isn’t my strong point!