Correct transition config for click / touch drag transition speed in fancybox-3 - transition

fancybox3 transitionDuration config does not seem to affect click / touch drag transition speed which is always very fast. Does anyone know how can i control this click / touch drag transition speed please?

Related

Unity New Input system click UI elements

My game is a 3D shooter, and the player can shoot if left mouse button is clicked.
The problem is that I have also an UI Menu with buttons to restart the game, but I cannot click those buttons because in my action map click is equal to shoot.
I try to disable the player input and change the current action map to none, so I can press the buttons like the old input system with the Onclick() but it doesn't work.
At the time of displaying a Game Over screen I tried to disable the lock of the cursor.
PlayerController.sharedInstance.GetComponent<ThirdPersonController>().enabled = false;
PlayerController.sharedInstance.GetComponent<StarterAssetsInputs>().cursorLocked = false;
PlayerController.sharedInstance.GetComponent<StarterAssetsInputs>().cursorInputForLook = true;
I think I can start shooting raycast and check what element of the canvas is hit, and by the name of the button perform actions by I don't think this is the best idea.
Could you tell how can I click my UI elements please?
Thank you in advance.

how to reference an "armature action" of a bow using code?

I'm trying to make a bow and arrow game. I downloaded a bow that has an animation(?) on it where the string is pulled back.
See:
I want to make a script that triggers that animation (shown on bottom-right of my gif) when Player left clicks. But I don't know how to reference the animation.
Is it something like _anim = GetComponent<Animator>(); and then animation.Play? I cannot tell what the name of the animation even is to do this.
Further.. it would be awesome to be able to control the animation's length depending on how long the user has held down the button, rather than playing it in full even if user only taps left click. I'm not sure how that would be achieved?
Ok, the question seems short but the solution will be long and you need to do a bit of learning. So, let's go through your question step by step.
I downloaded a bow that has an animation(?)
Yes, it is a 3D bow model with an animation in it.
I want to make a script that triggers that animation (shown on
bottom-right of my gif) when Player left clicks. But I don't know
how to reference the animation.
In order to trigger that animation, you need an Animator Controller attached to the bow model instance. Then you can click that Animator Controller to open its panel. After opening the panel, you can simply drag and drop your animation there. When you first drop your animation, it will be the default animation state. However, if you don't want to trigger the animation immediately, I would suggest you to create an empty state and make a transition to the bow animation.
Is it something like _anim = GetComponent(); and then
animation.Play?
More or less like this, but you should check the documentation for better understanding, this documentation explains it well and has a really good example for your use case.
I cannot tell what the name of the animation even is to do this.
Once you drag and drop the animation to the panel, you will see the name of the animation to use in the script.
Further.. it would be awesome to be able to control the animation's
length depending on how long the user has held down the button,
rather than playing it in full even if user only taps left click.
I'm not sure how that would be achieved?
There are many ways to play with animations, for example, you can set an animation parameter to stay in the animation state. Furthermore, you can also disable the Has Exit Time value from the transition to make it stop the animation immediately after the user stops holding the button.
Overall, when it comes to animations, Unity is quite powerful and my suggestion would be read the documentation and watch a couple of tutorials.
Hope this helps.

Drop In Drop Out System with Input?

I'm trying to code a drop in drop out system with input. Basically i have 2 sprites and im trying to swap between controlling each one. Right now I have a button i press and it switches which sprite is active however it does not let me show the animations for the other sprite and i can't control it. It also makes the other sprite that i'm not swapped to go off screen. I need both sprites to stay on screen and be able to press a button and and be able to control the other with the same input. If anyone could help me it would be much appreciated i couldn't find anything about it on google considering this is a very specific problem.

MacOS: Identify between NSMenuItem shortcut typed or mouse pressed

I have Spritekit game for the Mac. It includes NSMenuItems in the menu as with normal Mac applications. Now the thing is that
if I choose an action from the menu with the mouse, the Spritekit game starts executing right away and some of the subsequent animation is missed.
if I choose the same action with the keyboard shortcut, the game starts executing right away but none of the animation is missed since there is no delay switching from menu animation to game animation.
Is there some way to identify if the IBAction sent by the menu item is being triggered by the keyboard equivalent or by mouse? I want to add a start delay to the game animation if mouse is used and no delay for key equivalent.
The type of the current event can be obtained by reading NSApp.currentEvent.type.
See NSApp.currentEvent and NSEvent.type for details.

How to pan animator window in unity?

I cannot find any scrolling options in animator window. There are no scrollbars in animator window and I cannot find any other option for scrolling in animator window, so when I add more states it is hard to select as content cannot fit in window. See the screenshot reference. So is there any shortcut key like holding shift and move cursor? Please if any one know tell me how do I pan animator window?
Currently you cannot zoom in/out in unity animator window.
However, you can move the view around by holding alt+click or mouse wheel click and then move your mouse.
You need to hold the scroll button and move your mouse.
from unity's docs
You can right-click on the grid to create a new state nodes. Use the
middle mouse button or Alt/Option drag to pan the view around. Click
to select state nodes to edit them, and click & drag state nodes to
rearrange the layout of your state machine.