Author Topic: TNManager.Create() Problems  (Read 2270 times)

blueagardq15

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
TNManager.Create() Problems
« on: July 23, 2015, 02:36:21 AM »
I dont understand why I cannot do
GameObject ThePlayer = TNManager.Create (playerPrefab, AlphaParachuteSpawn [random].transform.position, transform.rotation, persistent);

It just gives me this error (): Cannot implicitly convert type `void' to `UnityEngine.GameObject'

I do not understand Please help me

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: TNManager.Create() Problems
« Reply #1 on: July 24, 2015, 08:22:21 AM »
TNManager.Create() does not return an object for you to reference. You have to move stuff you want that object to do into its own code (Start()) or write your own custom CreateEx() method. These are very easy to do as per the post on this subject in the sticky at the top of this forum. http://www.tasharen.com/forum/index.php?topic=5416.0
For example, I use CreateEx() to create objects and add them to lists that are synchronised across clients and servers.

If you searched, you'd find this info because Aren has mentioned it several times. ;)

Also, as for being 'unresponsive', you posted your query in someone else's unrelated topic. All in all, poor netiquette on your part.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager.Create() Problems
« Reply #2 on: July 24, 2015, 08:52:11 AM »
As Shifty Geezer mentioned, your question is answered in a sticky post here.

If you had simply read the sticky post, or just did a simple search, you would find the answer. In the future, don't make many posts asking the same thing, send PM, send email, and post on Unity forums all with the same question. It just wastes my time. One is more than enough, and this forum is the right place to ask.