0
$\begingroup$

node setup

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.

$\endgroup$
2
$\begingroup$

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')
$\endgroup$
2
  • $\begingroup$ Stop spamming this site with your advertisements. $\endgroup$
    – Chris
    Apr 29 at 8:46
  • $\begingroup$ Yep. Sorry, am new. Thanks for informing me. $\endgroup$ May 21 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.