Forum Discussion
GetPlayer GetVar in javascript
This is an old thread but I would use the browser developer tools to set a breakpoint on the if statement and probe to see exactly what kind of object you have in the player variable at that point.
I would expect that if player is not a null value (and checked by the if statement) then it ought to be a legitimate reference to the player and therefore the GetVar function should exist (but you can check this when the breakpoint is hit).
The other thing to do is check the console for any other errors that may have occurred prior to the breakpoint that might mean that the player object is not in a fully initialised state.
hi chris,
stumbled across this because i'm facing the same issue as original poster. the breakpoint doesn't seem to be showing anything specific and all im trying to achieve is to trigger the function.