Hello. I wanted to know if it would be possible to open a website (hyperlink) after clicking on an object. Normally you can have a left button sensor and a mouse over sensor working together so that both conditions must be met to perform and action (i.e. object can only be selected after hovering over and then clicking it), but that is when you connect if to an "and" controller, which I cannot do as the controller is for the script. With the current setup, it should open the URL after clicking the cube, but for some reason it opens it up when clicking anywhere available. Any solutions or alternatives? Thanks.
1 Answer
You can open a web URL in another browser with Python by running the following code at run-time.
import webbrowser
webbrowser.open('http://google.com')