Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: decerto on May 27, 2015, 10:31:18 PM
-
Hi,
When I use TNManager.Destroy() it works in game. However when I come off the server and rejoin, the object is still there. Was working on 2.0.4.
-
Reverted back to 2.0.4 and everything is working accordingly. Something is definitely wrong with the latest release.
I use TNManager.Create to create all my items in the world and TNManager.Destroy() when I pick them up. This works fine on 2.0.4 but as I said - on 2.0.6 the items reappear after logging out and back in again.
-
Hmm... Odd. I'll be putting out a new version of TNet soon -- either this week or next one regardless, and as far as I know everything works fine with it in Windward (as I am my own guinea pig) -- so whatever the issue was I'm hoping it'll be resolved.
-
I am also running into a similar issue. Destroying a gameobject via "TNManager.Destroy()" results in the object being destroyed on the host, but none of the clients.
My code looks like this - a host or client calls this ..
tno.Send("BuildDock", TNet.Target.Host);
Then this is fired.
[TNet.RFC]
void BuildDock()
{
TNManager.Create("WoodenDock", transform.position, transform.rotation, true);
TNManager.Destroy(gameObject);
}
Pretty simple and straight forward. Yet the TNManager.Destroy(gameObject) call doesn't destroy the object over the network. I should note, the gameObject in question has a "TNObject" component.
EDIT : So it appears calling "tno.DestroySelf()" instead solves my issue. So what exactly is the purpose of TNManager.Destroy then?
-
TNManager.Destroy doesn't exist in the current Pro version of TNet at all... although I should add it as a deprecated function instead.
-
I just want to point that this problem is now fixed on 2.1.0 version. Everything seems to be running correctly - will post anything if I find if not.
-
Hi. I wanted to bring up this topic because it's related to the issue I'm experiencing.
I'm using 2.1.1. The TNObject is persistent so that I fade out the character before destroying him. Originally I used TNManager.Destroy to get rid of an object. And I call it after he fades out completely. Worked fine.
I then saw that warning message that said it was obsolete and try something else. No big deal, changed it. I used TNObject.Destroy and saw that it destroyed it locally. However, players that joined afterwards would still create an instance of the destroyed object.
I tested this by having a standalone run as host and the editor join over and over. Each time I joined the previous players still existed. This didn't happen with TNManager.Destroy, however.
Suggestions?
-
Might be due to when you call the DestroySelf(). Are you currently in the channel (and not in the process of joining it)? If not, there may be issues. Check the code for it, all it does is sends the RequestDestroy packet, same as before. It certainly seems to work just fine in Windward, I use it everywhere.