Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tomgsx

Pages: [1]
1
TNet 3 Support / Re: How do you respawn a player?
« on: August 14, 2014, 12:01:36 PM »
Disregard, I figured it out. Was my error on the respawn script. First I had it attached to the object being destroyed, which clearly wasn't working. Then I had put it on an object I instantiated over the network - resulting in more ships respawning for no reason. Finally I figured it out and just placed it on a gameobject in the scene with a timer that resets and TNManager.Create's the new player if "myPlayer" is null.

For some reason I approached the respawn initially with the idea that simply restarting the scene would be simple since everything necessary to the player and dependent assignments happens when the Game scene is loaded. TNManager.Create worked just fine.

2
TNet 3 Support / How do you respawn a player?
« on: August 13, 2014, 01:40:35 PM »
I currently have a basic setup similar to your YouTube video where the initial scene uses TNAutoJoin and the game scene creates the player with TNAutoCreate. When any object is hit with a weapon, the following line is executed:

TNManager.Destroy(x.transform.gameObject);

At this point I want to respawn the object in the prefab's default position if the object destroyed was a player. I initially thought simply using Application.LoadLevel(1) would work since that scene contains TNAutoCreate, but it didn't seem to work out as intended. I would appreciate your help, thanks!

Pages: [1]