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$

1 Answer 1

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, 2021 at 8:46
  • $\begingroup$ Yep. Sorry, am new. Thanks for informing me. $\endgroup$
    – RPaladin
    May 21, 2021 at 22:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .