Browse Source

bug fixes in main.gd chat _ready

Added missing yield to main.gd and updated p1/p2 to get_path
Koyper 5 years ago
parent
commit
1add36112d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tutorials/networking/webrtc.rst

+ 3 - 3
tutorials/networking/webrtc.rst

@@ -188,12 +188,12 @@ Then you can use it like this:
         var p2 = Chat.new()
         var p2 = Chat.new()
         add_child(p1)
         add_child(p1)
         add_child(p2)
         add_child(p2)
-        get_tree().create_timer(1), "timeout")
-        p1.send_message("Hi from %s" % p1.path())
+        yield(get_tree().create_timer(1), "timeout")
+        p1.send_message("Hi from %s" % p1.get_path())
 
 
         # Wait a second and send message from P2
         # Wait a second and send message from P2
         yield(get_tree().create_timer(1), "timeout")
         yield(get_tree().create_timer(1), "timeout")
-        p2.send_message("Hi from %s" % p2.path())
+        p2.send_message("Hi from %s" % p2.get_path())
 
 
 This will print something similar to this:
 This will print something similar to this: