Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: tissueme on December 10, 2014, 08:08:01 AM
-
please Help me Thank a lot, I'm newbie in Tasharen Networking
public Animator anim;
bool runBool;
In Start
anim = transform.FindChild("Character").GetComponent<Animator>();
And Update
tno.SendQuickly("PlayAnimation", Target.AllSaved,runBool);
[RFC]
void PlayAnimation(bool run) {
anim.SetBool("idleBool",!run);
anim.SetBool("runBool",run);
}
-
Never simply send packets in Update().
Update() can run hundreds of times per second. You can't send that many packets without the network forcing them into batches, lagging everything. You need to send updates periodically -- for example 4 times per second.
In your case you are simply calling a function to play an animation. What's the point of calling it every Update? Simply call it once when it's time to play the animation. Or when something changes -- like run state gets turned on.