Forum rules - please read before posting.

Animate cursor on click

2»

Comments

  • edited July 2019

    A completely blank transparent texture in png format cannot exist. At least photoshop does not save anything when I do so, only if i put something like a dot it will save it.

    I did the trick with the dot to save the empty png. Now I have an invisible cursor going around the screen and a stable animating one in the middle of the screen that is not moving.

    What I want is when the player clicks on anything the pointer to play a small animation (like 10 frames) and then come to its former state.

  • A transparent PNG is perfectly possible - try this.

    In order to have the animated graphic follow the mouse cursor, you need to assign the "Rect Transform To Position" field in the script's Inspector. Unless the animation controls the RawImage's position, you can set this to the RawImage object.

    Is this animated graphic playing continuously, or only when you click (like it's supposed to)? If continuously, share screenshots on imgur.com so we can see what's wrong.

  • @ChrisIceBox ok now it works but when i use your png and set it as required by unity for cursors, (RGBA32, no mip maps, Alpha Is transparency, Read/Write Enabled and texture type as cursor or default or sprite ) I get a white box beside the working cursor ( which now animates whenever I click) Somehow the png is not read correctly as transparent. Oh and it does not show if i print screen what I see!

  • I get a white box beside the working cursor ( which now animates whenever I click) Somehow the png is not read correctly as transparent.

    Did you set the Texture type to Cursor? Let's see a screenshot of your settings.

    Oh and it does not show if i print screen what I see!

    As this graphic is now the hardware cursor, it's likely hidden automatically by your system's "print screen" operation.

  • edited July 2019

    Forget it it's solved, my bad. I had somehow forgotten the Replace mouse cursor check with a static cursor.

    Thank you so much for taking the time every single time! @ChrisIceBox

  • edited July 2019

    @ChrisIceBox Well there is still a problem. The cursor works fine, meaning when I click it plays a small 5 frame animation and goes back to being static. But when I click on any hotspot and a dialogue appears, the cursor changes to a static white rectangle and it remains like this what ever I do. Any ideas here ?

    Raw Image : https://i.imgur.com/F7p5W4n.jpg

    Canvas : https://i.imgur.com/9mI2qxJ.jpg

    Cursor manager: https://i.imgur.com/helQjJu.jpg

  • when I click on any hotspot and a dialogue appears, the cursor changes to a static white rectangle and it remains like this what ever I do

    By this, do you mean the Unity UI cursor, or the hardware one that should be hidden?

    If you're referring to the Unity UI cursor, what is the state of the Animator window at this time? Double-click the Controller field's "Move2" at runtime to open the live Animator.

    Also, what is the effect of clearing the "Unity UI Cursor" component's Raw Image To Control field, i.e. unsetting the Cursor RawImage value?

  • edited July 2019

    I think I mean the Unity UI cursor since I have Main Cursor Settings: Display cursor set to Never.

    If I double click the Move2 to see the live Animator I think the white box appears when the animator is at the one frame animation where the cursor is static.

    If I unset the Cursor RawImage I don't get an animated cursor but still when i click on a hotspot after that i get the white box.

    @ChrisIceBox you can have a better understanding here : https://youtu.be/9xNbKJlaTiA

  • Thanks for the video. I was under the impression that your cusor was animated by changing the texture. That it is instead handled by scaling the RectTransform means that the Cursor RawImage field should remain assigned.

    I cannot tell the reason for the white box, however. I think it would be best for me to see this for myself. If you can export an asset package with the files below, PM it to me and I shall take a look.

    • Your eight Manager assets
    • The UI cursor canvas, made into a prefab
    • The Animator and 2x animation files
    • All cursor graphics referenced by the Cursor Manager and Unity UI Cursor component
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.