playMaker

Author Topic: Animated mouse cursor?  (Read 1772 times)

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Animated mouse cursor?
« on: June 23, 2018, 11:58:32 AM »
Hi, I don't work with GUI elements often and I was wondering if someone could suggest a very basic workflow for having an animated cursor. Something simple like: The player moves the cursor (a circle) over a box, as it gets near/over the box it scales up, and scales back down as it is moved away from the box.

verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: Animated mouse cursor?
« Reply #1 on: June 23, 2018, 12:47:42 PM »
You would be getting the distance the mouse is from the box. then math, then scale the texture by the percentage your math calculated. sorry for the vagueness, but im not at home right now

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Re: Animated mouse cursor?
« Reply #2 on: June 23, 2018, 01:59:58 PM »
Ah interesting, though it doesn't even need to be that complex (actually based on distance), it could just be a locked scaling animation triggered by a mouseover event on the box's collider. Where I'm unsure is where the cursor texture...is. Like is that a 2D plane in the scene, something in a Canvas? Just not sure what best practices are with Playmaker in this instance.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Animated mouse cursor?
« Reply #3 on: June 23, 2018, 02:29:45 PM »
Hi.
There is a action "Set Mouse Cursor"
Maybe this is what you are looking for ?

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Re: Animated mouse cursor?
« Reply #4 on: June 23, 2018, 02:34:52 PM »
Thanks, but I believe an issue with Set Mouse Cursor is that it's using the system cursor, and as I understand it, a replacement of the system Cursor cannot be animated.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Animated mouse cursor?
« Reply #5 on: June 24, 2018, 10:28:54 AM »
Hi,
Ah ok,
So you are using sprites

I think it is best done with the animator, similar to a 2d sprite character but by using triggers or bools instead of using the axis float.

There are many animator and sprite sheet animation tutorials on youtube.
There are a whole bunch of animator action you can use, to transits to the different animations.

I Think i will make a tutorial video for this.
But think i won't have time to do that this week :(