- Home /
Unity Web Player
How can I disable right clik menu in the Web Player? (I'm using Unity 2.6x)
Answer by TheDemiurge · Nov 02, 2010 at 06:42 AM
Best you can do is lock the cursor. Read here: http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html
But because in a web build, hitting ESC will always free the cursor, all you really need to do is add Screen.lockCursor = true;
to the Update function of any single script, without the other stuff.
Answer by jonas-echterhoff · Nov 02, 2010 at 08:45 AM
You need to pass the disableContextMenu parameter to the unity embed in the html file. See the reference of embed parameters.
When you create a web build it generates an html file. Consider this file an example of how to embed your game in a web page, and modify accordingly. The call to unityObject.embedUnity is in the javascript on this page.
Answer by GFX47 · Apr 04, 2011 at 02:31 PM
Here's a complete solution for right click detection, including how to disable context menu for web player games: http://blog.gfx47.com/2011/04/04/detect-right-click-on-game-objects-in-unity3d/ Hope that will help! ;)
Your answer
Follow this Question
Related Questions
How to make a menu box on right click of object? 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
how do you show stats in webplayer? 1 Answer
Can people access my game assets through the webplayer? 3 Answers
Performance difference between webPlayer and Flash? 0 Answers