Animated Cursors in Unity!

  Рет қаралды 26,508

Code Monkey

Code Monkey

Күн бұрын

Пікірлер: 84
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Polish your game with Animated Cursors! Absolutely essential for Mouse-heavy games! 🌐 Have you found the videos Helpful and Valuable? ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php
@tudormuntean3299
@tudormuntean3299 4 жыл бұрын
Yeah , I did find them helpful . Please make more about visual scripting
@Oxmond
@Oxmond 4 жыл бұрын
Cool tutorial! Love animated cursors 👍🤓🧡
@Ephjoshy
@Ephjoshy Жыл бұрын
Remember if this does not work for you in a Standalone Build just enable the Read/Write parameter in the Texture Import Settings
@asemon007
@asemon007 4 жыл бұрын
Very useful!!! Your channel is awesome!
@tuyooyun8797
@tuyooyun8797 4 жыл бұрын
How do you make 2D design. They are so cute.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I draw all my assets in Photoshop, I'm not much of an artist but I'm constantly improving little by little!
@mahesh1124kingo
@mahesh1124kingo 4 жыл бұрын
OMG, you type whole sentences still I type only one word. You are the Fastest typer in which I known people.
@rxn7
@rxn7 4 жыл бұрын
u need to learn type faster if you want to be programmer
@mazdnd
@mazdnd 4 жыл бұрын
Most of programming is reading, the thing you do the least is typing code. You do NOT need to be a fast typer as a programmer, it's just a movie trope. Worry more about understanding data structures and common patterns and how they are used, that's way more important and what you'll spend more time on anyways :)
@InvoRL
@InvoRL Ай бұрын
@@mazdnd as a 150 wpm typer, that is 100% facts
@ibrahimrashwan
@ibrahimrashwan 4 жыл бұрын
Nice INTRO update much better 👍
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Thanks! I thought it was time for an update
@sujatabhattacharjee7100
@sujatabhattacharjee7100 4 жыл бұрын
i am a 9 year old boy and i love to code and i am making a game and u are helping me a lot
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
That's great to hear! Keep it up!
@sujatabhattacharjee7100
@sujatabhattacharjee7100 4 жыл бұрын
I am making a 2d platformer and watching ur vids
@skymario8327
@skymario8327 4 жыл бұрын
Yo, hey I really appreciate all of your videos. I just find them amazing and just really educative. However, I have come to realization that unity's built in 2D lights do not work well with walls and I can't really find a solution to this problem. I really do hope you can cover this with a tutorial, I certainly need this for my game to fully function. Hope to see the tutorial soon!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Check out the 2D Shadow Caster docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/2DShadows.html
@carsteinleung9235
@carsteinleung9235 3 жыл бұрын
Very useful! Thank you very much!
@TheVisualDigitalArts
@TheVisualDigitalArts Жыл бұрын
thank you this works great.
@PandemoniumGameDev
@PandemoniumGameDev 4 жыл бұрын
Another awesome tutorial! Was wondering why don't you use UniRX instead Update, I think it's going to improve the performance by quite a bit. Just my two cents.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Update gets called once per frame, can't really get more performant than that.
@PandemoniumGameDev
@PandemoniumGameDev 4 жыл бұрын
@@CodeMonkeyUnity What I mean is that update gets called once per frame but if we're checking for something to happen like a mouse click or a boolean statement to become true it's rather redundant to check it on every frame. UniRx makes scripts react to these events only when they happen therefore making them run faster. At least that's what I understood and it does make my games run faster.
@JovsValorant
@JovsValorant 4 жыл бұрын
I always watch your videos when they are uploaded. Its just sad that I cant try and do this myself with the project files because im not a patron yet. I want to support you as much as i want to but im currently a student and have no budget.
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
This one is pretty simple so you can just rewrite the code as shown in the video, use this opportunity to get better at drawing and make your own cursors!
@MrKiraBR
@MrKiraBR Жыл бұрын
Thank you so much!!
@TheTrolderia
@TheTrolderia 3 жыл бұрын
What is the art for most of your tuturials called? It's pretty cool
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Hmm no idea if there's a specific name, it's just a cartoony flat style
@JovsValorant
@JovsValorant 4 жыл бұрын
Pls make an in depth tutorial about animation, like the one u use in your tutorials. The character_base part. It was really performant but we dont know how to write that one. Beginner friendly pls. Lots of love from philippines
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
It's based on dynamically modifying meshes which I covered here kzbin.info/www/bejne/Z2LGaqWNh9SngJo
@457Deniz457
@457Deniz457 4 жыл бұрын
Nice ! Thanks ! :)
@wanman_
@wanman_ 4 жыл бұрын
Hello love your vids
@kingpen
@kingpen 4 жыл бұрын
Let's say I wanted to have custom cursor to use on my laptop, a Bowser sprite that would move and react to what you're doing. How would I go about that~? Would this tutorial help with that~? Thanks in advance~!
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 4 жыл бұрын
I really like video about DOTS :(
@bangojetty
@bangojetty 2 жыл бұрын
Hi Mr. Monkey. I just wanted to suggest something in regards to future tutorials. There are a few times in this video in which you explain what something does without explaining why it needs to do it. For example, at 6:26 you tell the viewer what is happening in the update function, but at no point do you explain why you needed to put any of it in there. If someone is using logic to try and find a solution without a tutorial, this is the the most likely thing they wont think about and therefore THE most important thing for you to explain. I know it may be difficult to clarify something so dull in an elegant way, but please, for the sake of aspiring developers, don't gloss over these sections without giving any clues as to their purpose. It takes one sentence to say why it needs to be in there. If I'm missing the mark here please let me know. I'm somewhat new to this stuff so I might just be misunderstanding. (edit: I may have just misunderstood what you DID explain. Using more accurate variable names or explaining your reason for naming them what you did would help a lot)
@junss3936
@junss3936 Жыл бұрын
For those who do not understand 6:26 Let us say that my PC is somehow able to constantly run at 1000FPS. Which means it takes 0.001s to run the next frame/update. (In this case, Time.deltaTime = 0.001s). [frameTimer -= Time.deltaTime] = 0f - 0.001f = -0.001f [frameTimer
@junss3936
@junss3936 Жыл бұрын
for those who are confuse with the names of the following variables: frameTimer ==> use to keep track of the countdown to change cursor texture frameRate ==> let you change the speed of cursor animation currentFrame ==> keep track of the current cursor texture being used frameCount ==> the total number of cursor texture in the cursor texture array. (this is being use in an algorithm as shown in my previous explanation of the code)
@vlakitus
@vlakitus 4 жыл бұрын
Thank you so much for that! Could you make an Ledge Grab tutorial for 2d platformer?
@vegitoblue2187
@vegitoblue2187 3 жыл бұрын
HeyI have a general coding question on unity. For referencing the denpendant components we cache them in variables to aboid using getcomponent every tick. Doesnt declaring the variable allocate separate memory? If it does then wont pointers be a better thing to use? Been learning c++ in ue4 for my job but this part is really confusing me
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
You mean a pointer to the original location of the GetComponent data? That's very unlikely to be an issue, at that point you're really fighting the language. C# is not meant to directly use pointers, it automatically handles memory allocation and garbage collection. So that shouldn't be a concern unless you're doing something extremely special.
@vegitoblue2187
@vegitoblue2187 3 жыл бұрын
@@CodeMonkeyUnity I see. Coming back to Unity from C++ in UE4 thanks for clearing this
@tudormuntean3299
@tudormuntean3299 4 жыл бұрын
The best
@palanolho82
@palanolho82 23 күн бұрын
Would there be any difference in implementing the animation based on time instead of frames?
@CodeMonkeyUnity
@CodeMonkeyUnity 22 күн бұрын
The logic is all based on time, you can define the maximum timer in any way you want, doesn't necessarily have to be based on the frame count
@dragonlord1935
@dragonlord1935 4 жыл бұрын
Hey, can you make a tutorial about how to load files at runtime? I'm asking because I want to see how feasible it is to implement some basic modding capabilities. Nothing major just some spritesheets, maybe a few JSON files (Or anything more in line with Unity) for simple data manipulation. Could you make a video on that?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I covered Saving and Loading here kzbin.info/www/bejne/bKawd3iDYtOUpqc
@nizanthp6257
@nizanthp6257 4 жыл бұрын
bro one Doubt How to Make 3D cube move in 8 direction movements in unity like press up and left arrow in keyboard they move diagonally when press two arrow keys.so bro make a video for 8 direction movement in unity. make this video fast i want to move the 3d character in 8 direction movement.
@auckzsv8599
@auckzsv8599 4 жыл бұрын
Hey! do you think instead of adding a script for each intractable prefab, to use a single interaction manager and use ray casting to detect the mouse hovering? i use it anyway for interaction purposes. i wonder which of them is more performant. Amazing video as always!
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Yup that would be another valid approach. In terms of performance since you really just have one mouse then it's unlikely to be an issue.
@memeaste7820
@memeaste7820 Жыл бұрын
I'm having an issue with OnMouseEnter. I have a debug line in it and the line is never displaying. I'm not sure why, since the object in question is set to trigger on its collider
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
Is that script attached to some object? Add a Debug.Log on Update to verify Maybe you added a 2D instead of 3D collider? unitycodemonkey.com/video.php?v=Bc9lmHjqLZc
@memeaste7820
@memeaste7820 Жыл бұрын
@@CodeMonkeyUnity the issue, that seems to be solved, with my conemachine confiner with the boundary being a polygon collider 2D trigger. It was blocking the object’s trigger. Thank you
@andrewpullins8817
@andrewpullins8817 Жыл бұрын
I am four years into developing my game and so far I have avoided using the singleton pattern. I don't know if my brain is just not working today but so far I can't figure out a good way to make this work without singleton 😕
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
There's nothing inherently wrong with singletons, they are a tool like anything else, in some cases they are the perfect tool, in other cases you should not use them So use them but don't abuse them
@andrewpullins8817
@andrewpullins8817 Жыл бұрын
@@CodeMonkeyUnity I know that there is nothing wrong with the pattern, but some turn it into an anti pattern which is what I have been trying to avoid. I guess I finally found a good use of this pattern as I seriously do not see these classes changing except if I need to do the events like you showed at the very end.
@adriking5383
@adriking5383 4 жыл бұрын
What does "frameTimer -= Time.deltaTime" do? Why is frameTimer not set to a number?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Time.deltaTime holds the number of seconds that have elapsed since the last frame. So when you run that on Update(); you get a timer while the game is running By not setting it to a number it simply defaults to 0f
@SayedSafwan
@SayedSafwan 4 жыл бұрын
Hello CodeMonkey,i use this script using UnityEngine; public class NewBehaviourScript : MonoBehaviour { void start() { Cursor.visible = false; } void Update() { Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); transform.position = cursorPos; } } but my default cursor is still visible.what should i do?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Function names are case sensitive, it should be "Start()" not "start()"
@md.abuyousuf6225
@md.abuyousuf6225 4 жыл бұрын
will it work on android?
@minar771
@minar771 4 жыл бұрын
Could this be done using ECS/DOTS?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
It could but why would you? It would add complexity without getting much benefit. There's only one mouse so performance is unlikely to be an issue
@maistrogaming7911
@maistrogaming7911 4 жыл бұрын
Hey man I want to ask you do you know how to mark in a map a destination ...like it show you who to go to that destination ...please replied ...I really need it
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
I made a Quest Pointer a while ago kzbin.info/www/bejne/mnndlnueYpiVppY
@relaxingsoundsforsleep6237
@relaxingsoundsforsleep6237 3 жыл бұрын
is there any way to clamp it also how do i make it less sensitive
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Clamp what? Its a hardware cursor so it has the sensitivity of your mouse
@relaxingsoundsforsleep6237
@relaxingsoundsforsleep6237 3 жыл бұрын
@@CodeMonkeyUnity hey thanks for responding I want the mouse to be clamped around my moving character, I figured put how to clamp it buy using transform.position = new Vector3 ((Mathf.Clamp (transform.position.x, -20, 20)), transform.position.y, transform.position.z -20, 20); this works to clamp in but I want it to be be within 20 of my character and i am not sure how to do that. once again thank you. a full copy of my code is public class cursor3 : MonoBehaviour { public Camera mainCamera; public GameObject cube; private Vector2 cuberposition; void Awake() { cuberposition = cube.transform.position; } private void Update() { Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit RaycastHit)) { transform.position = RaycastHit.point; } transform.position = new Vector3 ((Mathf.Clamp (transform.position.x, -20, 20)), transform.position.y, transform.position.z); } }
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
​@@relaxingsoundsforsleep6237 You can clamp the virtual mouse but not the actual hardware mouse. Use Vector3.Distance to see how far the mouse is from the character if you want a circular radius instead of a square.
@supertrooperdk
@supertrooperdk 4 жыл бұрын
Can you do a video on AI decision making like GOAP?
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
Not sure what that is but I covered Basic Enemy AI here kzbin.info/www/bejne/mpOTfIqPlryZm68
@supertrooperdk
@supertrooperdk 4 жыл бұрын
@@CodeMonkeyUnity Thanks, saw that one. GOAP is goal oriented action planning
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
🌍 Code Monkey on Steam! 👍 Interactive Tutorials, Complete Games and More! ✅ Add to your Wishlist! 👉 store.steampowered.com/app/1294220/
@theral056
@theral056 4 жыл бұрын
Did my tinfoil cap slip? I was just thinking about sprucing up my cursor!
@tudormuntean3299
@tudormuntean3299 4 жыл бұрын
Cool
@tudormuntean3299
@tudormuntean3299 4 жыл бұрын
I am going to say last instead of first
@PandemoniumGameDev
@PandemoniumGameDev 4 жыл бұрын
just say somewhere in the middle, it's going to return true most of the time :D
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,2 МЛН
Simple Chat Bubble in Unity! (Chat, NPC, Multiplayer)
18:28
Code Monkey
Рет қаралды 49 М.
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
I Wish I Had Known This Before I Started Unity Game Development...
11:11
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2 МЛН
Modular Character System in Unity (Move, Attack, AI, Pathfinding)
21:16
Our Minimalist Base Defense Game is Taking Shape! (Devlog)
11:50
Jonas Tyroller
Рет қаралды 100 М.
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,4 МЛН
6 Years of Learning Game Development
17:20
Cobra Code
Рет қаралды 217 М.
Ability Bar in Unity (Swap Weapons/Items)
29:07
Code Monkey
Рет қаралды 32 М.
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 201 М.