Transparent Unity App! (Overlay, Assistant, Particles)

  Рет қаралды 64,455

Code Monkey

Code Monkey

Күн бұрын

Пікірлер: 452
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
🌍 Monetize your games with AudioMob bit.ly/audiomob-codemonkey ❤️ Using this sponsored link helps support the channel
@kingbling7571
@kingbling7571 4 жыл бұрын
Cool now show one for mobile too 🤔
@slimebud
@slimebud 4 жыл бұрын
Hey @Code Monkey how to did you make your characters. Did you pay some one or make them your self. Either way you are my biggest inspiration and role model not lying. DM me on discord I am on the server and I want to almost interview you and learn from you. I really hope you can do it because it would mean so much to me.
@LowLevelLemmy
@LowLevelLemmy 3 жыл бұрын
"It's very simple, but also slightly complex" This sentence describes everything I've ever made in Unity. Thanks for the video Code Monkey!
@INeatFreak
@INeatFreak 4 жыл бұрын
This is what i've subscribed for. Didn't even know this was possible with in Unity.
@creeperperson9019
@creeperperson9019 3 жыл бұрын
ikr
@breakfastboii
@breakfastboii 3 жыл бұрын
I saw a game do it once and I was so confused as to how to do it
@rvwi9131
@rvwi9131 4 жыл бұрын
You really set yourself apart from other unity channels with those last few videos of yours...such unique content!
@TheEclipsedLock
@TheEclipsedLock 3 жыл бұрын
I was following this until I got to 7:46 at which I was very confused as to why nothing was transparent. I had followed the point to make the background 0,0,0, no alpha, and I was confused as to what was going on. The secret? Also change the "Clear Flags" option on the Main Camera from "Skybox" to "Solid Color". Build it and bam, the transparency is there :D
@neodubzero8448
@neodubzero8448 3 жыл бұрын
There's always a hero in the comment section!! I figured it had something to do with the background.
@Jack-bh5uo
@Jack-bh5uo 2 жыл бұрын
the year is 2022,so.... if that, maybe you should have check out you dont have set any URP at graphics,
@oxyphara
@oxyphara Жыл бұрын
I know that I had to change the clearflag from "Skybox" to "Solid Color" :)
@murilorocha531
@murilorocha531 2 ай бұрын
in unity URP, you need to disable the HDR in the (Universal Render Pipeline Asset) to work properly
@naeustudio
@naeustudio 13 күн бұрын
thx bro
@Fenixmaiden666
@Fenixmaiden666 2 жыл бұрын
About 4 years ago, I ended up using WPF to achieve this for a game counter / healing tracker. Thank you so much for sharing this, I can make all kinds of cool stuff with the ability to make overlays!
@louxie6367
@louxie6367 3 жыл бұрын
Ok quick tip for anyone struggeling to make it work (if you are writing the code manually): Make sure the function names (of the dll functions) are the same!! A spelling mistake will prevent it from being transparent. That's all. And thanks for the great tutorial! :D
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Yup when working with external functions they need to have the exact name
@ericmenaut
@ericmenaut Жыл бұрын
Thanks, I had a spelling mistake in a function and it was not working. Now all is perfect!
@kimen1
@kimen1 4 жыл бұрын
You’ve just created the Virtua Girl that many many years ago always brighten my desktop.
@ThainaYu
@ThainaYu 2 жыл бұрын
Updated: You don't need to use built in graphic. You can also use URP but it seem you need to remove some effect that would cause the background pixel to not be 0. Such as volumetric light in the scene that would make the BG lighten a little bit
@lewisbailey1000
@lewisbailey1000 2 жыл бұрын
Do you have any more knowledge of what to turn off? as i would love to use URP with the transparent window.
@ThainaYu
@ThainaYu 2 жыл бұрын
@@lewisbailey1000 When I was creating new project with 3D URP core. I only need to delete the `Volume` object that was present in the scene. And if I remember it right I just do every other things as this video suggest except changing pipeline to built in
@lewisbailey1000
@lewisbailey1000 2 жыл бұрын
Dw, i found the thing you have to disable
@jeffheid1821
@jeffheid1821 2 жыл бұрын
@@lewisbailey1000 What was it?
@IgorAherne
@IgorAherne Жыл бұрын
1 year later, for URP transparency, you have to untick "Post-Processing" (so it's not enabled) in your scriptable object "Universal Render Pipeline Asset_Renderer". Maybe there is a better way.
@samuelbeauquin
@samuelbeauquin 2 жыл бұрын
Great tutorial ! - Transparency work in URP in 2021.3 but you need to disable HDR and Post Processing.... - If you encounter an issue where transparent materials make what you have behind (e.g some opaque geometry) transparent as well, changing the blending mode from Alpha to Premultiply on these materials solves the problem.
@LostM00nOfPoosh
@LostM00nOfPoosh 2 жыл бұрын
Oh man thank you this has been driving me nuts! finally got it working with URP
@mindlessnessgames4074
@mindlessnessgames4074 2 жыл бұрын
Yes! thank you!
@kmat97
@kmat97 2 жыл бұрын
Thanks !
@三张-x9c
@三张-x9c Жыл бұрын
TKS I Love You
@theDarkerSan
@theDarkerSan 4 жыл бұрын
that's was the most distinct unity tutorial I have seen. nice as aways.
@raymk
@raymk 2 ай бұрын
All those tiny details about the settings etc. will save me 12 hours of debugging. THANKS HUGO, I LOVE YOU
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Transparent Unity! The amount of possible use cases for this is insane! How cool is that virtual assistant? 🌐 Have you found the videos Helpful and Valuable? ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php
@Jakal-Lantern
@Jakal-Lantern 4 жыл бұрын
I'm having an issue with the code. When I mouse over a button, it correctly changes the color to the highlight color. However, I can't actually click it. It just clicks through the button. Any ideas as to what I missed or did wrong? I checked and double checked that my code and build settings were the same, so I don't know what could be causing my issue. Edit: Finally found the fix. Because I was using UI elements, I needed "SetClickthrough(!CodeMonkey.Utils.UtilsClass.IsPointerOverUI());" in the update function.
@charmys2126
@charmys2126 2 жыл бұрын
nice this helped me thanks
@akc21adt
@akc21adt 4 жыл бұрын
Please make complete c# SERIES with unity.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
The Code Monkey Steam app will have lots of C# focused interactive tutorials so make sure you add it to your wishlist!
@Brioshie
@Brioshie 6 ай бұрын
Wow! So happy to have discovered this!
@BrainSlugs83
@BrainSlugs83 2 жыл бұрын
Get Active Window just returns the hwnd for whatever window is active, not necessarily *your* window. I would recommend using a different method to get your window handle.
@joshleap
@joshleap 5 ай бұрын
I was just thinking the same thing. I wonder if there's a way through the unity API to grab unity's window handle. EDIT: looks like System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle did it for me. Got this working in an hdrp project infact. Just need to be careful about your post processes you select.
@protobilly
@protobilly 4 жыл бұрын
@codemonkey- Does this not work with Unity UI/Canvas? I noticed you use your button_sprite plus colliders instead of the built in system.
@protobilly
@protobilly 4 жыл бұрын
nm- if you put "SetClickthrough(!CodeMonkey.Utils.UtilsClass.IsPointerOverUI());" in the update of the Transparent Window it'll include Unity UI, instead of only sprite collision.
@Fluxxn
@Fluxxn Ай бұрын
thanks, works perfect now!
@AriAmphibian
@AriAmphibian 2 ай бұрын
I was able to get the script working decently, but I ended up running into the issue of using the Utility in the script. I was wondering if this was the only way of doing the collider interaction side of it or if there was any other way I might be able to do it. Help would be appreciated
@CodeMonkeyUnity
@CodeMonkeyUnity 2 ай бұрын
What issue? The raycast doesn't hit anything? Make sure you're not mixing 2D and 3D colliders/physics
@AriAmphibian
@AriAmphibian 2 ай бұрын
@@CodeMonkeyUnity the issue is mostly setting up a system that makes the window only be selected whenever an object has a collider rather than relying on pixels. I’m wanting to make some objects intractable while others would be able to exist without getting in the way.
@AriAmphibian
@AriAmphibian 2 ай бұрын
@@CodeMonkeyUnity the issue with the utility was I didn’t know where to find it or how to install it to my project, but I’m not sure it would have fixed my problem anyway.
@omochila
@omochila 3 ай бұрын
Great video as always! I'm using it for a bit now trying to make a virtual pet, ended up using the simple alpha solution because I wasn't able to make it work with both UI and GameObjects... but still working! thanks CM
@jvukovic4
@jvukovic4 2 жыл бұрын
quick question, is there anyway for an overlay program thats out of focus to recieve controller inputs? I want to make a program where you can practice fighting game combos with active notation, and wanted to see if i can put a program over a fighting game so that people have a combo trainer.
@willemvdb1828
@willemvdb1828 4 жыл бұрын
Hey code monkey are you gonna do a series to learn coding It would really help me
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
The Code Monkey Steam app will have lots of C# focused interactive tutorials so make sure you add it to your wishlist!
@willemvdb1828
@willemvdb1828 4 жыл бұрын
@@CodeMonkeyUnity does it cost money
@DrFizzyQuizzler
@DrFizzyQuizzler 4 жыл бұрын
You too can rebuild clippy!
@prozip1913
@prozip1913 8 ай бұрын
This tuto doesn't work with Unity 2022.3 in Built-in and URP :') Edit: After disabled HDR Rendering in the camera, it works. I guess we absolutly have to create an URP Project for that because i'm not sure we have the HDR Rendering option on the camera component :0
@CodeMonkeyUnity
@CodeMonkeyUnity 8 ай бұрын
Yup if you add some post processing it does mess up the transparency. I'm still using this just like I made it here, haven't updated beyond Unity 2019
@chad499
@chad499 6 ай бұрын
@@CodeMonkeyUnity This actually is possible in 2022.3 using URP: I followed most of your procedure but added a camera override: Camera.main.clearFlags = CameraClearFlags.SolidColor; Camera.main.backgroundColor = new Color(0, 0, 0, 0);
@rowanhofmann6485
@rowanhofmann6485 4 жыл бұрын
THANK YOU SOOO MUCH! I couldn't follow the discussion properly, then I stumbled across this video, and it works! so thankful!
@rambovalle8881
@rambovalle8881 3 жыл бұрын
The windows bar doesn't show up when moving mouse to the bottom of the screen if transparentwindow application is running. Is there a way to get windows bar to show up when moving mouse to bottom of the screen?
@ThisIsAUsername69
@ThisIsAUsername69 7 ай бұрын
Did you ever figure this out?
@Alzimovich2
@Alzimovich2 4 жыл бұрын
Hey CM! What about implementing a Portal-like mechanic, in one of your next videos? I know this is, in general, a highly requested topic, but most of the tutorials I found don't make use of very flexible code.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Sebastian has an excellent video on it kzbin.info/www/bejne/mYjTd42Yn9mGh8k It looks simple but to make it work right it's actually surprisingly complex. I would love to make a mini 2D Portal one day, playing with momentum is a ton of fun.
@SC2pl
@SC2pl 7 ай бұрын
How can I run this on my second monitor? I am able to run my program on my second monitor, but once I activate your script the program runs on my main monitor
@chad499
@chad499 6 ай бұрын
inside the function SetWindowPos(hWnd, HWND_TOPMOST, NEWLOCATIONX HERE, NEWLOCATIONY HERE, 0, 0, 0)
@michaelnichxls
@michaelnichxls Жыл бұрын
This is actually a good tutorial in general for introducing interoperability
@diegoantunes3419
@diegoantunes3419 4 жыл бұрын
Hey man! Great fan form Brazil here! Your videos are AWESOME! I already have your course in wishlist on Steam. Your content is VERY helpful! Thanks! I'd like to ask for a video creating a nice cinematic in Unity for game advertising... if possible with tips and techniques as didatic as you always are... thanks!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Cinematics are tricky because they are very specific. Essentially you either animate the camera manually or go with Cinemachine + Timeline
@klitac
@klitac 5 күн бұрын
hello and thank you for the video. i have a problem i tried writing the same code as you but my unity dont have the same buttons and features as yours. i tried downloading project file but when i double click it opens unity hub but then nothing happens? If i click "Add project from disk" i cant select the project file i downloaded? do you know what is wrong? thank you 😭
@klitac
@klitac 5 күн бұрын
i just deleted everything and write everything again and i cant even get the first message box to show after hitting run with this code. the background turns blue inside unity then nothing happens. using System; using System.Runtime.InteropServices; using System.Collections; using System.Collections.Generic; using UnityEngine; public class TransparentWindow : MonoBehaviour { [DllImport("user32.dll")] public static extern int MessageBox(IntPtr hWnd, string text, string caption, uint type); private void start () { MessageBox(new IntPtr(0), "Hello World!", "Hello Dialog", 0); } }
@ahmada.1037
@ahmada.1037 4 жыл бұрын
i did what was in the script and all settings in unity but its not working, the camera alpha is also set to 0 and color to black, im using unity 2019.4 Personal edition pls help (also my camera looks a bit different then yours is)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Did you untick that box'? are you using the built-in render pipeline?
@ahmada.1037
@ahmada.1037 4 жыл бұрын
@@CodeMonkeyUnity yes i did uncheck the box and am using the built render pipe line
@JustinFraser314
@JustinFraser314 3 жыл бұрын
My app is working (mostly as intended) but just one question. When I try to interact with the app while KZbin is playing, the audio keeps playing but the KZbin video turns white? Does this happen in your project?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Never had that issue, and I've used this to make the annotation app for my Game Dev Reacts videos where I write on top of KZbin. Maybe try a different browser?
@zlarnix
@zlarnix 3 жыл бұрын
I got an error: Assets\TransparentWindow.cs(50,9) error CS1501 No overload for method 'SetWindwPos' takes 7 arguments
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
It's "SetWindowPos"
@zlarnix
@zlarnix 3 жыл бұрын
@@CodeMonkeyUnity Still get the same error. I go wride the whole code again.. I hope that the error is then gone
@dylanking000archive
@dylanking000archive 3 жыл бұрын
literally every question i have you have a video for. thanks for everything.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Heh yeah with over 500 videos I've already covered tons of topics! Thanks!
@dam3277
@dam3277 10 ай бұрын
great tutorial, but is there a way to interact with the game without it going to the window behind it? I also want the player to still interact with their desktop when their mouse isn't over any gameobject, I have no idea if that's even possible second, how do you make it turn back into a regular solid color (non-transparent)? sorry if it's too much to ask!
@socpensVOD
@socpensVOD 2 жыл бұрын
does not seem to work with any Post Processing using URP, should probably note that in the video
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
I did say it only works in BRP. At least back when I made this URP didn't work at all, with or without post processing
@walterwhite42068
@walterwhite42068 4 жыл бұрын
Thank you so much! I wanted to do this but couldn't find a solution for years now. Will shaders on UI images work with this? Edit: In detail, I want to have a Gaussian blur effect on UI Image that will blur everything in desktop (aka the background). Is it possible to do that? I just tried and it doesn't work sadly :( Please provide a workaround
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
This makes the background transparent, it doesn't copy it. You need to figure out some way of capturing the desktop rather than just making it transparent, I'm sure it's possible but no idea how.
@theDarkerSan
@theDarkerSan 4 жыл бұрын
I used this effect in UI before. in shader graph theres a way to grab the background and aply to the shader to make it look "invisible" I think it would work in this case too.
@walterwhite42068
@walterwhite42068 4 жыл бұрын
I have made a bg capturer before which blurs it on awake and sets to correct images. I'll try it here and let you know.
@walterwhite42068
@walterwhite42068 4 жыл бұрын
@@CodeMonkeyUnity Sadly shaders do not work....
@3lH4ck3rC0mf0r7
@3lH4ck3rC0mf0r7 4 жыл бұрын
I've researched this topic before. Unity doesn't (and can't) run its graphics instructions directly on top of its window. Unity renders the scene into a separate buffer (the BitBlt buffer), which then DWM copies the pixels to wherever the Unity window is. And when DWM copies the graphics buffers around and renders the actual window, it uses its own shaders that are essentially out of your reach. With some extra DWMAPI instructions it is possible to enable DWM's own blur and DirectComposition shaders, but not much more than that, you can't apply custom Unity shaders and post-processing effects directly on window composition. Now, since then, extra window masking flags have been added for Windows 10 allowing to record the desktop, but excluding certain windows from the rendering entirely. Such windows become completely invisible to all forms of screenshots and desktop recording (except from hardware capture cards, of course). Then you could go with a faux-transparent window that's actually opaque, but takes screenshots of the desktop while excluding itself from them, to add to those screenshots completely within Unity, where all shaders are fair game.
@EclecticDev-vv8nk
@EclecticDev-vv8nk 9 ай бұрын
So many interesting things in this video I learned that would have taken me forever to figure out myself. Thank you so much.
@tomicooltomi
@tomicooltomi 4 жыл бұрын
Very nice! Would it perhaps be possible to minimize the program to system tray while still fully working?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yup that's doable, I believe it's with Shell_NotifyIcon();
@navy3001
@navy3001 3 жыл бұрын
I followed all the steps and the window is not transparent.
@prz1968
@prz1968 3 жыл бұрын
If you are using URP trye to uncheck the HDR on quality setup
@bonjoseph1563
@bonjoseph1563 3 жыл бұрын
Thanks for everything CodeMonkey! Just wanted to ask a question. How can we show UI buttons text in the screen using this? I added a UI button but it's not in the screen. Hope you can help out!
@clumsypanda1039
@clumsypanda1039 4 жыл бұрын
hey code monkey, i really appreciate your work! i love your channel and explanation because you clearly explain the basic and then show us the exact example about what condition that you can use the code/method
@jvukovic4
@jvukovic4 2 жыл бұрын
What an awesome vid, with plenty of resources and easy to follow: great work!
@PulloffPrime
@PulloffPrime Жыл бұрын
if this worked before, it no longer does. the txt box pops up but the background is still showing without transparency.
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
Are you using URP? It does not work in BiRP Do you have custom shaders with custom post processing?
@HadiExtreme
@HadiExtreme 4 жыл бұрын
Hmmm... The possibilities of this are endless. Great video!
@DxBALLxD
@DxBALLxD 4 жыл бұрын
I'm just.. sufficiently impressed by your dedication. Diligence.. A lot of respect, man. It's cool and cute, lmao
@Garfield_Minecraft
@Garfield_Minecraft 9 ай бұрын
this gonna be fun :3 I'll recreate clippy
@TheGreenSprout
@TheGreenSprout 10 ай бұрын
Hey, works great, thanks! Any idea how someone would make it so that the application becomes clickable with 3D colliders? Im trying to do something like this with 3D models, but don't know how I would make it work with 3D colliders. Thanks again!
@TheGreenSprout
@TheGreenSprout 10 ай бұрын
Update! I figured out I can add a script to interactable objects that has an "OnMouseEnter" and an "OnMouseExit" function that modifies a bool variable that dictates if the window is interactable or not. I have come across another problem, which is that when Im running a videogame that removes my toolbar when playing, even when the game is running "below" other apps, when I run the transparent unity application it removes my toolbar when in use. Any ideas on how to fix this? (the issue doesnt appear if the videogame is minimized or closed)
@Pedro_Marangon
@Pedro_Marangon 4 жыл бұрын
1:20 hey @CodeMonkey, how do you maded the lines? I was researching that topic (for an idea for a drawing app) but I couldn't find anything on that - like, I did found something about but it was by instantiating an object a bunch of times to make a line
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
While the mouse is down it is constantly storing the mouse position and adding vertices to a mesh. Basically every frame 2 vertices get added and connected to the previous 2, it's a constantly growing series of quads. I covered how to handle Meshes through code here kzbin.info/www/bejne/Z2LGaqWNh9SngJo
@mishathegiant
@mishathegiant 2 күн бұрын
Hello! Thank you for this amazing tutorial! I made a small game using this transparent window but I can't for the life of me figure out how to make a setting to change the monitor the game is running on. Every single one of them that I tried make the screen white for some reason. Hope it is not a big thing to ask but I really don't know who to ask but you
@symbolgames1670
@symbolgames1670 3 жыл бұрын
For some reason when i do this code, it gets rid of EVERYTHING that is black, not just the camera background, it doesn't matter if it isn't transparent, if it's black it's gone... I dunno how to fix this easily
@progCan
@progCan Жыл бұрын
do the part around 14:20 and if that does not work here is the code: using UnityEngine; using System; using System.Runtime.InteropServices; public class TransparentWindow : MonoBehaviour { //Example using various API's [DllImport("user32.dll")] public static extern int MessageBox(IntPtr hWnd, string text, string caption, uint type); [DllImport("user32.dll")] private static extern IntPtr GetActiveWindow(); //This is used to make the window click trhu. [DllImport("user32.dll")] private static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong); [DllImport("user32.dll")] private static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags); //This is used to interact [DllImport("user32.dll")] static extern int SetLayeredWindowAttributes(IntPtr hWnd, uint crKey, byte bAlpha, uint dwFlags); private const int GWL_EXSTYLE = -20; private const uint WS_EX_LAYERED = 0x00080000; private const uint WS_EX_TRANSPARENT = 0x00000020; //This is used to run in the background. private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); //This is used to interact private const uint LWA_COLORKEY = 0x00000001; private struct Margins { public int cxLeftWidth; public int cxRightWidth; public int cyTopHeight; public int cyBottomHeight; } [DllImport("Dwmapi.dll")] private static extern uint DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins margins); private void Start() { #if !UNITY_EDITOR IntPtr hWnd = GetActiveWindow(); //Make the window background transparent.(Bare Minimum we need) Margins margins = new Margins { cxLeftWidth = -1 }; DwmExtendFrameIntoClientArea(hWnd, ref margins); //Make the window Click thru but can be clicked on non transparent. SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_LAYERED | LWA_COLORKEY); //SetLayeredWindowAttributes(hWnd, 0, 0, LWA_COLORKEY); SetWindowPos(hWnd, HWND_TOPMOST, 0,0,0,0,0); #endif } } this 99% should solve it.
@symbolgames1670
@symbolgames1670 Жыл бұрын
@@progCan sadly I have long since figured out this issue BUT your info is not wasted as it will help anyone else with the struggle
@MrDracodi
@MrDracodi 4 жыл бұрын
First of all great video, really loved the idea of having a transparent background and wanted to try it out myself. I soon hit a wall when I did not manage to get it to work on URP, i tried to recreate it inside a normal unity 3d Project afterwards and there it did work so i wanted to ask you if you it is normal that it does not work on URP or if there might be a way :)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yeah it does not work in URP, only with the Built-in render pipeline.
@polerin
@polerin 4 жыл бұрын
@@CodeMonkeyUnity any ideas on how you could get this to work? There are several things about the URP that I'd like to use in my project.
@adamchochowski5357
@adamchochowski5357 2 жыл бұрын
Hi CodeMonkey! Awesome tutorial, quick Question what material setup are you using with your assistant running on transparent window (believe you run him/it on Mesh?)... currently struggling with some runtime made Mesh (not visible in build only in editor)... so maybe you can give some tip about material setup.
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Yes it's a dynamic mesh with a standard shader. unitycodemonkey.com/video.php?v=11c9rWRotJ8 This system only works in the Built-in Render Pipeline, I couldn't get it to work with URP
@OrangeOrangesMax
@OrangeOrangesMax Жыл бұрын
It would be really appreciated if there was an updated version of this. I couldn't get it working from the video so I downloaded the project. I fixed the errors in the project, made the changes to build settings (setting render pipeline to the built in) and it didn't work. I can get everything to show on screen but the background stays black. I looked at the comments and tried removing the lighting sources and volumes, removing post processing, removing HDR, etc but I still can't get the background to be transparent. All I can think of next is to try an older version of Unity...
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
I still use the exact same project that I used here nowadays, it's what I use for my livestream overlay. I haven't updated the Unity version so maybe that's it, maybe tehre's something in newer versions that breaks this in some way
@mr_spork4762
@mr_spork4762 9 ай бұрын
Great tutorial!! works perfectly for me, but ruins my fps flicking by between 30 and 60 every few seconds. Without the transparency its a stable 60 so i know its the script. Do you have any ideas on how to make the script run smoother, I tried disabling the gameobject after the code executed on start but it didnt seem to change anything.
@NumorGames
@NumorGames 3 ай бұрын
Hey did you ever fix this? Currently having this issue haha. Went from 300 fps+ to the same range as you.
@kubixqaz
@kubixqaz 3 жыл бұрын
I have a problem. there are 3 important scenes in my project. menu without transparency, and plays with transparency. but when you want to go back to the menu, the transparency is still there. I don't know how to fix it
@christopherhodge
@christopherhodge 2 жыл бұрын
Superb video, it definitely sparks a lot of neat ideas. Question though - I've been trying to get this to work with a virtual keyboard to send macros for games. Is there a way to have the window always remain out of focus but still allow the clickthrough to send a simulated keystroke ? I have tested the virtual keyboard to work fine (just sending a keystroke on update to a notepad), but when I try to use it via unity button, the window takes focus so the keystroke doesn't target the previous window as I would have hoped. I looked on pinvoke and saw the method for GetActiveWindow thinking I could just store whatever hWnd was active and then use the SetActiveWindow to go back there, send the virtual keystroke, but no luck unfortunately. Would love to hear any thoughts you might have on keeping the window always on top, but always out of focus ?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Hmm maybe you can make the Unity window clickthrough and instead of using a regular button just add some code testing for Input.GetMouseButtonDown(0) and doing a Raycast yourself to see if the mouse clicked on a button. But not sure if that works, not sure if Input.GetMouseButtonDown(0) still triggers if the window is clickthrough
@christopherhodge
@christopherhodge 2 жыл бұрын
@@CodeMonkeyUnity I tried doing that first but it seemed as though each click would still focus the window. I eventually found this which helped out, however, it hides the icon on the taskbar, which is ok I suppose. const int WS_EX_NOACTIVATE = 0x08000000; SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_LAYERED | WS_EX_NOACTIVATE);
@philipandrew9107
@philipandrew9107 2 жыл бұрын
I can't get the last bit to work, the button accepting input - how did you get the last bit to work, for me it always allows me to click through, for the very last part of the video. Does the button need to be made in some way
@MetalStormGames
@MetalStormGames 4 жыл бұрын
Your channel and videos are awesome. They really help inspire me to make games as well as to keep trying to make my own youtube series as well. Great job
@freecode.ai-
@freecode.ai- 4 жыл бұрын
Question: This is awesome. Did the project just to learn from it. How did you go about writing on the screen since you cant capture the mouse down on the transparent portions? Thanks
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Instead of using the Raycast method I just used a button toggle. So I press a button and it makes the whole window capture clicks, then I draw, then press the button again and it's all clickthrough
@ugothmeex
@ugothmeex 2 жыл бұрын
cool but how do i turn off the transparent effect. like a toggle button switchin from on and off.
@BlackteaBEEF
@BlackteaBEEF 3 жыл бұрын
Can I use the UI button replace the 2D sprite?
@Ziprava42
@Ziprava42 7 ай бұрын
I tested the message boxes, their type like uint it shows a lot of windows types(ok, about, yes or no or cancel and just yes and no)
@BrandonLeeHail
@BrandonLeeHail Жыл бұрын
Im a bit new to all of this but miraculously I was able to get this to work. I believe returning the functionality to the button(from the windows api transparency script) was done using the buttom_sprite script? How can I make a dropdown work with the transparent background? My friend has been helping my but was overwhelmed by the buttom_sprite script.
@Tacthose
@Tacthose 4 ай бұрын
I'm terribly late on this but I followed all the video and at the end when i click on something with a collider it click also on the window in the background. Does someone has a sollution for that ?
@navy3001
@navy3001 3 жыл бұрын
What is "code monkey" in the video? Since I can't make what that is i can't continue the video..
@WindmillsLightStudio
@WindmillsLightStudio 3 ай бұрын
hello, do you can discover what is it? i'm don't can continue too..
@martingoc4215
@martingoc4215 3 жыл бұрын
I'm sorry to write this comment. But my transparency system does not work. When I turn on the application on the fulscreen, I only have a black screen, when I click the mouse where the windows button should be, the start menu opens, which I see but besides that I don't see anything else.
@TanijaTheFaun
@TanijaTheFaun 3 жыл бұрын
Okay, I literally tried everything at this point - I followed every single step, unchecked the boxes, changed Alpha and color, even tried scripts by other people that tried the same and downloading several other versions of Unity, even the one you used here. I cannot get it to be transparent, not a single time. This is extremely frustrating. :/
@Flyce_9998
@Flyce_9998 3 жыл бұрын
This may sound stupid but have you added the script to some object on the scene? I was in the same scenario until it hit me I had to do that
@Goldengingergirl
@Goldengingergirl 3 жыл бұрын
Have you tried setting the fullscreen mode to "fullscreen window"? That's where I went wrong
@Euforia706
@Euforia706 2 жыл бұрын
Where does the code "CodeMonkey" come from? You just send it to call and that's it, but I don't see it declared anywhere
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
CodeMonkey.Utils is the namespace for my utilities, you can access a namespace from anywhere (as long as the source code is included in the project of course)
@Bloodair
@Bloodair Жыл бұрын
Hi, nice tutorial, I have one question, how would You go around to making the game run on the wallpaper behind the desktop icons and the windows bar ?
@asterism__
@asterism__ 5 ай бұрын
Hi there! I'm attempting to use the clickthrough function, however am unable to use it on 3d objects (3d objects are unable to be interacted with). Any tips on how I could achieve this would be great.
@asterism__
@asterism__ 4 ай бұрын
For anyone stumbling upon this I simply added this to my Update function to fix the issue: Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); SetClickthrough(!Physics.Raycast(ray.origin, ray.direction)); Hope this helps!
@BlainesterSIndustriesYT
@BlainesterSIndustriesYT 9 ай бұрын
btw we all know people are going to try to make one of those virus looking horror games with that method but with a few more tweaks
@HINCO38
@HINCO38 3 жыл бұрын
I did everything as in the video, and I can't click on the button) although when you hover the color changes 0o I wanted to make a MessageBox appear when you click, but the clicks are not registered(((
@Limofeus
@Limofeus 3 жыл бұрын
THIS IS REALLY COOL! Thanks a lot for the tutorial!
@chaostellar
@chaostellar 3 жыл бұрын
Bro im getting a black screen when i build the project, trust me i copied everything, and saw all the comments (Unity Version : 2019.4.12f1)
@karlhenderson8463
@karlhenderson8463 3 жыл бұрын
did you manage to fix it?
@chaostellar
@chaostellar 3 жыл бұрын
@@karlhenderson8463 I had windows 7 maybe that's why. (win 10 is working fine)
@epicei
@epicei 3 жыл бұрын
I can't seem to make this work. It either shows up as a gray square in the middle of the screen or as a tiny transparent bar with the close, resize and minimize buttons. I've tried several unity versions and everything. A bit confused.
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Are you using the built-in renderer?
@epicei
@epicei 3 жыл бұрын
@@CodeMonkeyUnity So I finally made it work. Quickly though, any tips on making it work on multiple displays? Looks like it doesn't at all work with multiple displays.
@epicei
@epicei 3 жыл бұрын
Did it. It works. Using it on two screens was a little bit funky, but it works great. Finally!
@SticKai
@SticKai Жыл бұрын
Can you tell me how to make collision with a desktop tab
@specstrem
@specstrem 4 жыл бұрын
How do i make it so that its behind the taskbar because i use the collapsed taskbar and i cant get it to show up because the game is in the way?
@alexsc7505
@alexsc7505 4 жыл бұрын
This channel is the main reason on why I will dedicate to program in my future (I'm just 12)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
It's awesome you're starting so young! Go for it!
@alexsc7505
@alexsc7505 4 жыл бұрын
@@CodeMonkeyUnity Yeah I'm hopeful, but my PC overheated a year ago... :(
@Mirza-oz8ff
@Mirza-oz8ff 3 жыл бұрын
can i apply shader or post processing effects to background based on certain action? (i want to know shader effects will apply to background or not) example: turn screen colors to black & white, or apply bloom-glare to colors, or blur screen
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
By background do you mean the Windows background? If so no, at least not with this method, since there is no background, it's transparent.
@Mirza-oz8ff
@Mirza-oz8ff 3 жыл бұрын
@@CodeMonkeyUnity my mean by background, was about desktop background or if the user is working with a tool/program, the shader apply on it example: turn desktop screen blurry
@prodragon6
@prodragon6 3 жыл бұрын
@Code Monkey hey I'm just looking for advice on your transparency code, I made it work but it doesn't play nice with TMP and causes resizing issues for internal windows. any idea why that is? I have it passing everything through problem free until it tries to make new text and parent to a thing within my window
@Matt-fm1wo
@Matt-fm1wo 3 жыл бұрын
Is it possible to make a 3D object (like the cube) clickable/draggable for example? Or does interaction only work on sprites? Is there some special method for interacting with objects perhaps?
@Matt-fm1wo
@Matt-fm1wo 3 жыл бұрын
I figured it out. I think the main thing was having the keyboard and mouse work when it's not in focus (I used the rewired asset to do so, but it's possible with other windows API)
@RoadHater
@RoadHater Жыл бұрын
@@Matt-fm1wo Could you provide specifically how this was accomplished?
@themattempire42
@themattempire42 Жыл бұрын
@@RoadHater not sure as this was a LONG time ago...but I think based on my comment you have to make your app always in focus, so if you click on other things the app is still 'on top' kind of thing.
@bombi7375
@bombi7375 2 жыл бұрын
Hey CM, I am having an issue with the collider check. I want to use a RigidBody2D with the script but the collider check does not work while the rigidbody is dynamic. Do you know a way around this?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Are you using a Rigidbody2D? kzbin.info/www/bejne/eJScnaB-n9Z_kMU
@blitzkreig4887
@blitzkreig4887 2 жыл бұрын
How do I create a Transparent overlay on top of an UI Image or certain passive UI Elements, to allow the user to make in-game annotations ?
@KasperSOlesen
@KasperSOlesen Жыл бұрын
I was trying this out, but just could not get it to work. I have tried several things... I figured maybe it was because I was using a newer version of Unity so I downgraded. I tried double checking all the settings, ensuring the camera settings were right, but I even installed the package from the website and used the scene from that. Only thing I can think of that it might be, is that Unity logo at the startup. Because I get whatever graphics I have in the scene, but the background is completely black. Solid black instead of transparent. I thought maybe it was one of my other running apps that caused the problem, but I closed that and still no difference.
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
I haven't tried it in new versions but the one I used here still works nowadays. Importantly it only works on the built-in render pipeline so make sure you're not using URP in the project. Also don't add post processing or anything that uses depth textures or something like that, those can cause problems.
@KasperSOlesen
@KasperSOlesen Жыл бұрын
@@CodeMonkeyUnity might be something specific on my computer, I have tried several versions of Unity now, several different ways of doing the code, I can get it to be on top and be click through, but I cannot get the transparency working. I didn't other transparency Unity examples and I could not get any of those working either. I have made sure not to use URP, disabled HDR and any other special features, went over the project settings several times, tried making changes to the boot logo since I cannot disable it. But i always have a solid black background.
@luisrosado7223
@luisrosado7223 8 ай бұрын
Im subscribed but i would really appreciate it if you provided Code outside of the Unity IDE for personal analysis. I dont use the Unity Platform but i am trying to create certain effects for other languages.
@CodeMonkeyUnity
@CodeMonkeyUnity 8 ай бұрын
The .unitypackage includes all the source code, so if you're not interested in Unity you can import it onto an empty project and then just grab the source code and copy paste it to your non-Unity project
@shogoun94
@shogoun94 Жыл бұрын
Hello, i appreciate your work !! I just wanna ask does this transparent work on build ??
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
Yes, I make the build at 7:30
@nursyahidatulasyiqin8724
@nursyahidatulasyiqin8724 Жыл бұрын
Is it possible to have the screen not in fullscreen but set to 3840x1080? How?
@nursyahidatulasyiqin8724
@nursyahidatulasyiqin8724 Жыл бұрын
Hi, i still hv problem with this. Can anyone help me
@rodolforincon8431
@rodolforincon8431 4 жыл бұрын
do you know if this is possible to do in vr? like i want my transparent window to run on top of other games
@drtringuyenzmc
@drtringuyenzmc 2 жыл бұрын
Hey, thank you so much to your tutorial, I just wanna quick asking if this work on MAC build too?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
This is using the Win32 API directly so no, maybe the Mac API has similar functions but no idea.
@drtringuyenzmc
@drtringuyenzmc 2 жыл бұрын
@@CodeMonkeyUnity thank you so much, this is exactly what I'm afraid. There are some apis that only work with certain os. Last time I have the same problem with itext when run on Mac. Thank you so much for instant reply. If you can show me some keyword more to search for this problem it will be supper helpful. I searched with all keywords related to your subject but for Mac and still find no hope yet. Thanks so much
@In-N-Out333
@In-N-Out333 4 жыл бұрын
When doing menu animations, do you use the animator or a tweening plugin?
@orun1
@orun1 4 жыл бұрын
You don't need a plugin for tweeting: kzbin.info/www/bejne/gp2Wqqigo556jLM Here's a tutorial. Btw if the link doesn't work just search you're animating UI wrong, it's a video from Game Dev Guide.
@In-N-Out333
@In-N-Out333 4 жыл бұрын
@@orun1 That video only shows you how to do it with a plugin. Did you even watch it?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Normally just code based tweening but I never go too crazy with my menus.
@DevVand
@DevVand 2 жыл бұрын
OMG THE DOWNLOAD ARCHIVES ARE A TOTAL MESS
@GiantCloudGames
@GiantCloudGames 10 ай бұрын
Could I blur the screen somehow? like a gaussian blur or frosted glass.
@CodeMonkeyUnity
@CodeMonkeyUnity 10 ай бұрын
Don't think that's possible, through this method Unity has no context on what is behind it
@hedyxalil9736
@hedyxalil9736 4 жыл бұрын
Can you make video about when in game chapter 1 end after that how a player and camera go to chapter 2 another location and map how this can be done alike call of duty somthing alike that ? thx
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Usually you just load a completely different scene. If you try to smoothly move the camera you're going to have to deal with dynamically loading and unloading or you end up with memory constraints.
@eschewary367
@eschewary367 2 жыл бұрын
Got it working, thank you so much! To anyone who's done this and gone further, I want a transparent window, which I have, but I can't move it, it's stuck where it's placed when built. Where can I go for info on resizable, movable windows?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
The way I do it is use this in full screen then make a UI window just like any game window which can be dragged. It's what I used to make a Poll window in my Livestream overlay unitycodemonkey.com/video.php?v=Mb2oua3FjZg
@eschewary367
@eschewary367 2 жыл бұрын
@@CodeMonkeyUnity Thank you for the reply. That solution won't work for me because I need the actual Unity app Windows API window to be resizable/draggable. I think I need to switch WS_POPUP with WS_OVERLAPPEDWINDOW, now trying to disentangle that from StephanM's code haha
@pratikbose38
@pratikbose38 4 жыл бұрын
Thank you for making this great video, this is exactly what I was looking for!!
@prz1968
@prz1968 3 жыл бұрын
Thank you for this great tutorial, but I have a little isue, the application disappear (I need to click on it in the windows bar to make it visible again) when I click out of an UI element the SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, 0); method seems to doesn't work. I use the Unity 2020.3.18f1 on windows 10 19042.1237 build. Do you have the same isue with my configuration or did i make a mistake somewhere ? Regards, Pascal
@prz1968
@prz1968 3 жыл бұрын
Ok I find the solution, in Standalone player option, the visible in background must be checked
@overlord--
@overlord-- 2 жыл бұрын
Can you look into getting this to work with Unity 2021.3 HDRP with the ability to have post-processing? This would allow some cool stuff! Thank you!
The Internet Played My Game (and it did not go well)
9:27
advancenine
Рет қаралды 265 М.
Day in the Life of a Game Dev and YouTuber
12:19
Code Monkey
Рет қаралды 70 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
I Made a Desktop Pet in Godot
16:02
RachelfTech
Рет қаралды 133 М.
Simple Liquid Simulation in Unity!
15:46
Code Monkey
Рет қаралды 137 М.
Build Awesome Easy to Use Tools with Custom Editors!
23:59
Code Monkey
Рет қаралды 42 М.
The MOST WANTED Unity Feature is FINALLY here!
12:15
Code Monkey
Рет қаралды 50 М.
Making UI That Looks Good In Unity
18:06
Game Dev Guide
Рет қаралды 696 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
I made a Desktop Cat | Devlog 1
5:05
Boon Makes Games
Рет қаралды 14 М.
Unity Code Optimization - Do you know them all?
15:49
Tarodev
Рет қаралды 199 М.
SAVE & LOAD SYSTEM in Unity
18:20
Brackeys
Рет қаралды 1,1 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН