when created a StreamPeerTCP inside a function it will not woking?
code:
func onConnect_pressed():
print("Start")
var client = StreamPeerTCP.new()
print(client.connect("127.0.0.1",2003))
this code is not working when i press the button
but if write like this, put a var out side the func then sign to it, it works.\
code:
var client
func onConnect_pressed():
print("Start")
client = StreamPeerTCP.new()
print(client.connect("127.0.0.1",2003))
is there any different?