Sep 16, 2020 19:14
ok, glad to help!
Sep 16, 2020 19:13
jsut to show some message like "hello", and see if this part is actually executed.
Sep 16, 2020 19:13
let's do another check (to properly debug, we need to understand which exact code is executed):

Try to add a `Debug.log` _inside_ the `if` block
Sep 16, 2020 19:05
What I suspect is that counter is updated in the script of each object, and in the UI what is shown is the counter of the player (which stays always at zero).

One simple solution would be to make counter a `static` field, so it will be the same value shared among all the instances.
Sep 16, 2020 19:04
ah, then I can see a problem here. If you have this script on several instances, then they have each their own copy of all the fields (counter, and Score)
Sep 16, 2020 19:00
exactly.

On which object is the script that you showed us?
Sep 16, 2020 18:55
I mean, do you use Score.text somewhere in your scene / UI? If you just add Debug.log(Score.text); after Score.text = counter.ToString();, does it show the correct value?
Sep 16, 2020 18:55
and what about the debug log?
Sep 16, 2020 18:55
you are testing on the transform obstacle but you are destroying GameObject Obstacle, it's confusing. Is obstacle always Obstacle.transform ?
Sep 16, 2020 18:55
Are you sure you are actually using "Score" somewhere?
 

The Meta Room

General chat & hangout for Stack Overflow, including Meta disc...
Jun 18, 2020 09:05
@Mast Thank you so much for the anonymous vs registered votes stats., I thought that the message "your vote is not shown but still counted!" was a complete fake / myth.
Oct 2, 2019 12:42
in rythm
 
Sep 20, 2018 12:51
I deleted my answer since it doesn't actually apply, apparently. This is actually looking very much like valid JSON.
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Aug 24, 2018 08:33
But yeah, closure means basically that the inner function "keeps a reference" to the wrapping function's variable, if they are used in the inner function.
Aug 24, 2018 08:32
not a native either ;) . Anyway the "freeze" word doesn't seem right to me. I hope you don't mean "it keeps some xerox copy of the variables". The local variables of the wrapping function can be changed by other means than inside the inner function.
Aug 24, 2018 08:16
I call "closure" the function and the variables that it refers "around" the function, as you said more or less
Aug 24, 2018 08:15
As far as I use it
Mar 28, 2018 10:03
yep, which should cover a large part of developpers ;)
Mar 28, 2018 09:39
you can have a look here : stackoverflow.com/questions/7431365/…
Mar 28, 2018 09:38
@Nerva : ok, so it definitely loks bad to me. in UTF-8, your binary data qill be transformed in all kinds of special characters that are invalid for HTTP messages
Mar 28, 2018 09:35
@Nerva I'm back to documentation, I think I did mixed it up, maybe it's ok
Mar 28, 2018 09:32
so readasText simply won't work
Mar 28, 2018 09:32
yes, PDF is binary
Mar 28, 2018 09:32
and also, if you are not reading textfiles, your files will be corrupted after transformation.
Mar 28, 2018 09:31
What are you doing with the result? Send a POST request to your website ?
Mar 28, 2018 09:29
@Nerva But what kind of file are you transmitting ?
Mar 28, 2018 09:28
(I mean a binary file, i.e. a .pdf or a .png)
Mar 28, 2018 09:27
That can depend on your usecase.
If you want to upload a file through a web form, using base64 is simpler to code (IMO)
 

SO Close Vote Reviewers

This room is for support and discussion about reviewing and co...
Aug 22, 2018 13:50
you can rotate them to have more rows of text, very handy when coding
 
Aug 15, 2018 12:35
and how many lines does your files have, at least on average ?
Aug 15, 2018 12:35
can you measure time taken for various sizes (like a 1MB file, a 10 MB file and a 100MB file), so we can get an idea of the way the time increases with size ?
 
Jul 26, 2018 20:36
@BradleyDotNET that was my point, and I'm tool lazy to flag each relevant comment there. (that was interesting, though, but it feels like my AdBlocker isn't working anymore on this specific page :P )
Jul 26, 2018 20:36
Can we not turn these comments into advertisement for bing reward program ?
 
Apr 20, 2018 09:48
you're welcome, thank you too
Apr 20, 2018 09:46
now testCall() is actually a Promise, but you don't need to get a return value from this wrapping function, so it should work.
Apr 20, 2018 09:46
like
async function testCall() {
var x = await getData();
console.log(x);
}

testCall();
Apr 20, 2018 09:45
Can you wrap your code in an async function ?
Apr 20, 2018 09:45
so unfortunately, on the "top level" (without being in a function), you cannot use await.
Apr 20, 2018 09:44
Yes, I see, that's because you can only use await in an async function.
Apr 20, 2018 09:43
Just concerning your question, an async function will always return a Promise, that's how it works.
Apr 20, 2018 09:41
(sorry for English errors, not my language)
Apr 20, 2018 09:41
not too much, but I can check some time to times.
Apr 20, 2018 09:40
let me know if this works.
Apr 20, 2018 09:40
no problem
Apr 20, 2018 09:39
I edited my asnwer to fix the way await should be used.
Apr 20, 2018 09:39
Hi
Apr 20, 2018 09:38
(yes, I can with this one, thank you)
Apr 20, 2018 09:38
Then, use the second option, this one should not cause trouble.
Apr 20, 2018 09:38
can't follow this kind of link from where I am. Please copy the message as text.