game development

Unity: How I’ve made a moving cursor on a bar

Here’s how I’ve made the basic cursor moving on bar, here’s the code:

https://pastebin.com/7x4seP3R

First it was moving outside the bounds of the bar so what I’ve tweaked is the timing by making it much smaller. By doing that, the system checks where the cursor is at much more often. With that, I have made the Vector 3 y-coordinate speed much smaller since the delay happens much less. When it was time to change the direction of my bar (from going up to going down and vice versa), I just added a – (negative sign) to move Where so that it goes opposite. The code works like perfectly well!

Also Read: COMPARING AND CONTRASTING RPG MAKER MV VS SRPG STUDIO

One Reply to “Unity: How I’ve made a moving cursor on a bar

Leave a Reply

Your email address will not be published. Required fields are marked *