Accessed none trying to read property from function: Noob physics and cameras?

You need to connect that execution wire to be able to set that variable, otherwise it will do nothing. You could connect the white wire you have on the middle of those two branches, remember to wire the set variable nodes output back to the other branch.