No video

Transparent Unity App! (Overlay, Assistant, Particles)

  Рет қаралды 60,017

Code Monkey

Code Monkey

Күн бұрын

🌍 Monetize your games with AudioMob bit.ly/audiomo...
✅ Get the Project files and Utilities at unitycodemonke...
Let's make a Transparent Unity App! Build Overlays on top of the desktop or make an Assistant to tell you corny jokes!
👇
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!
✅ Add to your Wishlist! 👉 store.steampow...
Sponsored by AudioMob
Game Developer Reacts to Watch Dogs!
• Game Developer Reacts ...
Game Developer Reacts Ghost of Tsushima!
• Game Developer REACTS ...
Unity Layers, Layer Mask, Bitmasks, Bitwise Operators
• Unity Layers, Layer Ma...
Research:
forum.unity.co...
forum.unity.co...
answers.unity....
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonke...
📝 Get the Code Monkey Utilities at unitycodemonke...
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonke...
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey

Пікірлер: 434
@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 2 жыл бұрын
"It's very simple, but also slightly complex" This sentence describes everything I've ever made in Unity. Thanks for the video Code Monkey!
@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
@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" :)
@kimen1
@kimen1 4 жыл бұрын
You’ve just created the Virtua Girl that many many years ago always brighten my desktop.
@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!
@theDarkerSan
@theDarkerSan 4 жыл бұрын
that's was the most distinct unity tutorial I have seen. nice as aways.
@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!
@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 11 ай бұрын
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 Жыл бұрын
Yes! thank you!
@kmat97
@kmat97 Жыл бұрын
Thanks !
@user-cs6ik5gs1n
@user-cs6ik5gs1n Жыл бұрын
TKS I Love You
@Jakal-Lantern
@Jakal-Lantern 3 жыл бұрын
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!
@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
@rowanhofmann6485
@rowanhofmann6485 3 жыл бұрын
THANK YOU SOOO MUCH! I couldn't follow the discussion properly, then I stumbled across this video, and it works! so thankful!
@michaelnichxls
@michaelnichxls 10 ай бұрын
This is actually a good tutorial in general for introducing interoperability
@BrainSlugs83
@BrainSlugs83 Жыл бұрын
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 Ай бұрын
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.
@EclecticDev-vv8nk
@EclecticDev-vv8nk 5 ай бұрын
So many interesting things in this video I learned that would have taken me forever to figure out myself. Thank you so much.
@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
@dylanking000archive
@dylanking000archive 2 жыл бұрын
literally every question i have you have a video for. thanks for everything.
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Heh yeah with over 500 videos I've already covered tons of topics! Thanks!
@jvukovic4
@jvukovic4 2 жыл бұрын
What an awesome vid, with plenty of resources and easy to follow: great work!
@DrFizzyQuizzler
@DrFizzyQuizzler 4 жыл бұрын
You too can rebuild clippy!
@Brioshie
@Brioshie 2 ай бұрын
Wow! So happy to have discovered this!
@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
@williamfox8669
@williamfox8669 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.
@williamfox8669
@williamfox8669 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.
@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 5 ай бұрын
this gonna be fun :3 I'll recreate clippy
@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
@HadiExtreme
@HadiExtreme 4 жыл бұрын
Hmmm... The possibilities of this are endless. Great video!
@DevVand
@DevVand 2 жыл бұрын
OMG THE DOWNLOAD ARCHIVES ARE A TOTAL MESS
@Limofeus
@Limofeus 3 жыл бұрын
THIS IS REALLY COOL! Thanks a lot for the tutorial!
@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 kzfaq.info/get/bejne/mb2geb2Tz9q3gZs.html 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.
@justyourfellowfrog
@justyourfellowfrog Ай бұрын
nice. this will help a lot, i think
@dam3277
@dam3277 6 ай бұрын
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!
@pratikbose38
@pratikbose38 4 жыл бұрын
Thank you for making this great video, this is exactly what I was looking for!!
@navy3001
@navy3001 3 жыл бұрын
I followed all the steps and the window is not transparent.
@prz1968
@prz1968 2 жыл бұрын
If you are using URP trye to uncheck the HDR on quality setup
@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.
@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();
@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 3 жыл бұрын
@@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.
@echogames1036
@echogames1036 4 жыл бұрын
Thank you so much dude, this helped me a lot!
@HiHi-iu8gf
@HiHi-iu8gf 3 жыл бұрын
Yooooo this is exactly what I've been looking for how to do for a few years now pogg
@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
@bonjoseph1563
@bonjoseph1563 2 жыл бұрын
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!
@Gydoyt
@Gydoyt 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"
@Gydoyt
@Gydoyt 3 жыл бұрын
@@CodeMonkeyUnity Still get the same error. I go wride the whole code again.. I hope that the error is then gone
@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 3 жыл бұрын
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.
@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 2 жыл бұрын
@@karlhenderson8463 I had windows 7 maybe that's why. (win 10 is working fine)
@JustinFraser314
@JustinFraser314 3 жыл бұрын
My app is working (mostly as intended) but just one question. When I try to interact with the app while KZfaq is playing, the audio keeps playing but the KZfaq 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 KZfaq. Maybe try a different browser?
@travisco13
@travisco13 3 жыл бұрын
Thanks man, very very cool
@TheGreenSprout
@TheGreenSprout 6 ай бұрын
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 6 ай бұрын
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)
@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
@gelis07
@gelis07 3 жыл бұрын
me trying to make an "activate windows" watermark prank to my brother xD
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
That's a fun prank!
@gelis07
@gelis07 3 жыл бұрын
@@CodeMonkeyUnity haha thanks and thanks for the tutorial too!
@dex5454
@dex5454 4 жыл бұрын
Your utils are amazing but you should do a video on how to make your own custom utils! Also, Keep up the amazing vids!
@bluedev6304
@bluedev6304 3 жыл бұрын
Disclaimer: This will not work for linux or mac coz this uses windows api calls. And I couldn't find a way to get it in linux/mac with unity
@prozip1913
@prozip1913 4 ай бұрын
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 4 ай бұрын
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 2 ай бұрын
@@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);
@paulindrome
@paulindrome 2 жыл бұрын
Sweet tutorial, mate! One question, though: Would this work for android apps?
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
This is using the Win32 API so no, at least not exactly like this
@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 ?
@TanijaTheFaun
@TanijaTheFaun 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
Have you tried setting the fullscreen mode to "fullscreen window"? That's where I went wrong
@honybeea_ch
@honybeea_ch 8 күн бұрын
it didn't work for me, but it's a great tutorial, thanks!
@rambovalle8881
@rambovalle8881 2 жыл бұрын
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 3 ай бұрын
Did you ever figure this out?
@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... :(
@Ziprava42Userme
@Ziprava42Userme 3 ай бұрын
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)
@BlainesterSIndustriesYT
@BlainesterSIndustriesYT 5 ай бұрын
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
@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
@Diamondesignsempires
@Diamondesignsempires 4 жыл бұрын
Good tutorial!
@Tacthose
@Tacthose 25 күн бұрын
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 ?
@SC2pl
@SC2pl 3 ай бұрын
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 2 ай бұрын
inside the function SetWindowPos(hWnd, HWND_TOPMOST, NEWLOCATIONX HERE, NEWLOCATIONY HERE, 0, 0, 0)
@rayfarandyfalkana252
@rayfarandyfalkana252 Жыл бұрын
Best Tutorial for making Vtuber engine
@MasterofFire-sc3yn
@MasterofFire-sc3yn 4 жыл бұрын
About this amazing tutorial and your app on Steam. You can make it so that if we enter a class name in a field, It shows the description of that class, what it does, etc. That would be a great a help in code!
@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 kzfaq.info/get/bejne/Z5eTbNWIt9XYemw.html
@imDanoush
@imDanoush 6 ай бұрын
That's superb! Can you explain how to make it work for Android as well?
@socpensVOD
@socpensVOD Жыл бұрын
does not seem to work with any Post Processing using URP, should probably note that in the video
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
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
@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?
@rickloyd8208
@rickloyd8208 4 жыл бұрын
I wish we can do similar on a mobile :)
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I believe lately Android and iOS have been allowing more apps to run in parallel so I'm not sure it's possible now but I'm guessing it will be possible in the future
4 жыл бұрын
That was supper cool!
@masoudv1840
@masoudv1840 4 жыл бұрын
thanks for a clean and easy tutorial, this fixed half of my problem, but half of problem still remains! i`m trying to make a stereoscopic transparent scene in unity, by 2 cameras , one assigned to Main desktop window (windows 10) and second to Display 2 (two monitors attached to one VGA (extended nvidia display)), by using this script: void Start () { Debug.Log ("displays connected: " + Display.displays.Length); // Display.displays[0] is the primary, default display and is always ON, so start at index 1. // Check if additional displays are available and activate each. for (int i = 1; i < Display.displays.Length; i++) { Display.displays[i].Activate(); } } but your method applies transparency (-1) only to"active window"! how can i access second display to set its background to transparent?
@Tylorix
@Tylorix 2 жыл бұрын
justo lo que buscaba, excelente
@PinikRahman
@PinikRahman 3 жыл бұрын
video starts at 3:10
@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: kzfaq.info/get/bejne/gtJjrNib05-rhoU.html 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.
@tostpl8258
@tostpl8258 4 жыл бұрын
Can you make a c# tutorial about [flags] enum pls? I mean, that isn't that hard but I got some troubles while using it like 5 days ago. Btw now everything is working(I would like to see this tutorial because someone else maybe had similar problems).
@prodragon6
@prodragon6 2 жыл бұрын
@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
@DimitarUzunov1412
@DimitarUzunov1412 4 жыл бұрын
That was amazing, thanks
@spicysama
@spicysama Жыл бұрын
love you for your so excellent work
@openmacroinput
@openmacroinput 3 жыл бұрын
Big thank you.
@asterism__
@asterism__ Ай бұрын
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__ Ай бұрын
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!
@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
@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);
@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
@mr_spork4762
@mr_spork4762 5 ай бұрын
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.
@BailOfTheVeil
@BailOfTheVeil Жыл бұрын
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.
@overlord--
@overlord-- Жыл бұрын
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!
@clumsypanda1039
@clumsypanda1039 3 жыл бұрын
hey, nice tutorial how to make it transparent from green color instead of black?
@luisrosado7223
@luisrosado7223 4 ай бұрын
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 4 ай бұрын
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
@GiantCloudGames
@GiantCloudGames 7 ай бұрын
Could I blur the screen somehow? like a gaussian blur or frosted glass.
@CodeMonkeyUnity
@CodeMonkeyUnity 6 ай бұрын
Don't think that's possible, through this method Unity has no context on what is behind it
@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
@philipandrew9107
@philipandrew9107 Жыл бұрын
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
@antounkassouf8644
@antounkassouf8644 4 жыл бұрын
That was helpful ty
@RedstoneinventeArmoredGuy
@RedstoneinventeArmoredGuy Жыл бұрын
Am doing that for Android and everything is working great. But how should I go about making the clicks go through?
@nursyahidatulasyiqin8724
@nursyahidatulasyiqin8724 10 ай бұрын
Is it possible to have the screen not in fullscreen but set to 3840x1080? How?
@nursyahidatulasyiqin8724
@nursyahidatulasyiqin8724 10 ай бұрын
Hi, i still hv problem with this. Can anyone help me
@BlackteaBEEF
@BlackteaBEEF 3 жыл бұрын
Can I use the UI button replace the 2D sprite?
Day in the Life of a Game Dev and YouTuber
12:19
Code Monkey
Рет қаралды 68 М.
Build Awesome Easy to Use Tools with Custom Editors!
23:59
Code Monkey
Рет қаралды 41 М.
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН
wow so cute 🥰
00:20
dednahype
Рет қаралды 30 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 2,8 МЛН
Making a VIRUS for a Game Jam (and almost winning)
9:36
Deynum Studio
Рет қаралды 312 М.
The Internet Played My Game (and it did not go well)
9:27
advancenine
Рет қаралды 235 М.
Create Transparent Apps Like Discord's Overlay w/ Electron
14:09
tylerlaceby
Рет қаралды 13 М.
Splines are Awesome!!!
11:13
Code Monkey
Рет қаралды 149 М.
Google maps makes me mad. I'll make my own.
2:24:36
sphaerophoria
Рет қаралды 72 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 707 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 525 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
TOP 10 NEW Systems and Tools AUGUST 2024! | Unity Asset Store
8:04
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН