Author Topic: How i can attach player's name on a 3D text ?  (Read 2382 times)

Van

  • Guest
How i can attach player's name on a 3D text ?
« on: October 15, 2013, 05:44:26 PM »
Hello all,

I follow the tutorial video "How to make game from scratch", and i adding an 3D text at the top of the Capsule with the text Player 1.

My problem is i dont know how i can do for changing my 3d text dynamically if i have 1 other player connecting with the text player 2 for the second capsule.

Thanks for your help.

Best regards,
Van
« Last Edit: October 15, 2013, 06:09:48 PM by Van »

addebooi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: How i can attach player's name on a 3D text ?
« Reply #1 on: October 16, 2013, 04:35:53 PM »
You could eather use the "OnNetworkPlayerJoin (player)" and send an RFC to the player who joined to change to the current text. Or so could you only send it manually to the other players with RFC's when you change it. Example:
  1.  tno.Send(1, Target.Others, "text1", "text2");
  2.  
  3. //function
  4. [RFC(1)]
  5. public void changeText(string text1, string text2){
  6.      objectText1 = text1;
  7.      objectText2 = text2;
  8. }
  9.  

Van

  • Guest
Re: How i can attach player's name on a 3D text ?
« Reply #2 on: October 16, 2013, 05:31:27 PM »
Hi,

Thanks you very much for your answer and help, sorry for my english and am very new user with Tnet.

I have a last question :

what is the best way for let others player set their name's and what commands i'll use for updating their name's.

Many thanks again,

Best regards,
Van

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How i can attach player's name on a 3D text ?
« Reply #3 on: October 18, 2013, 04:09:23 PM »
TNManager.playerName = "ArenMook";