Can I edit multiple animation transitions at once in the Unity Editor? - unity3d

Is it possible to edit a group of animation transitions at once? When I select several animation transitions (as in the screenshot below) and change some properties in the Inspector (such as Transition Duration), the changes don't seem to take effect. The properties look like they change, but when I click elsewhere in the Editor and then click back on the transition, the property still has its old value.

No. Multi-editing for animation transitions isn't supported.
Source: https://issuetracker.unity3d.com/issues/transition-editing-multiple-transitions-cannot-be-edited

Related

How Can I make 2 transition form 1 state? in Unity2D

I made 1 transition from a state in the animator controller and I tried to make one another transition from the same state, but there is no "make transition" menu.
How can I make 2 transition from 1 state?
Unity Version is 2020.3.32f1.
I put the picture when I couldn't make another transition.
I think it seems the menu is something strange..
There is no "Make transition" menu.
Right click in the state where you want to start transitioning
I updated Unity Editor version to 2020.3.33f1, and it fixed.
I think it's seems bug in 2020.3.32.f1.

Unity - Animator Controller - Store previous state

I have a locker with 4 drawers. Every drawer is an individual object. Every drawer has its own animation for opening it. I have a problem with transition. If I open the first drawer and then open the second (or third), the first drawer will automatically close.
The next picture shows the object after the first animation (ThirdDrawer_Open)
The next picture shows the object after the second animation (SecondDrawer_Open)
I want to store the previous state of animation so when I open the second drawer, the previous one doesn't close/end.
From the Animation States docs, there are various exposed properties on states that you can edit. One property is called Write Defaults. From the docs, it is described as
Whether or not the AnimatorStates writes back the default values for
properties that are not animated by its Motion.
In your case, if this is enabled whenever you change your states for drawers, it will write the defaults back to the other drawers causing them to close. A solution would be to un-toggle this property so defaults are not written, or you can forcibly overwrite these values at runtime using WriteDefaultValues. I generally prefer the prior solution as WriteDefaults can be a headache to figure out and work with at times.

NSButton in Swift, handle click and release events

i'm trying to manage different state of a simple push button on an OS X application : When the user click on it, and when the user release the click.
Currently i set my button type by NSMomentaryLightButton
NSMomentaryLightButton When the button is clicked (on state), it
appears illuminated. If the button has borders, it may also appear
recessed. When the button is released, it returns to its normal (off)
state.
This type of button is best for simply triggering actions because it
doesn’t show its state; it always displays its normal image or title.
This option is called Momentary Light in Interface Builder’s Button
inspector
I thought it was the good way, but when i print my button status, it's like a toggle button than the push button that i set. As you can see on exemple gif
To sum up, How can i have a real push button behaviour ? Call function when the user click on it, and when the user release the click.
Thank,
You don't want to use buttons for piano keys. First, they are non-rectangular, and they don't act as buttons do: neither single-action push-button, nor toggle switches. You are interacting in a custom way, with a custom view, meaning the NSButton control hierarchy isn't called for. Instead you're subclassing NSView and capturing low-level mouse events as detailed here:
https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/EventOverview/HandlingMouseEvents/HandlingMouseEvents.html#//apple_ref/doc/uid/10000060i-CH6-SW1
You found this yourself as you detailed in your own comments, but I wanted to make sure you had a higher level point of view. It's even possible, and probably best, to consolidate all of the piano keys into a single view, and let the keys themselves be rendered using NSBezierPath and perform mouse hit detection using containsPoint:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBezierPath_Class/#//apple_ref/occ/instm/NSBezierPath/containsPoint:
This is a lot more work but the only way to make a truly professional looking piano simulation. Then you can render the keys with whatever outline, fill, and labeling you need without the limitations of built-in button shapes and layout. You could even have the bottom edges of the keys slightly rounded, for example, or apply a shiny texture.

Unity UI button not reacting to clicks or hovering

I'm using Unity 3D's new UI system to build a pause menu for my game. Currently I'm trying to have my buttons respond to mouse clicks. Some of my hierarchy is as follows:
When I click on one of my buttons in-game nothing happens, this includes a lack of button animation that should occur when hovering. My "Main Canvas" gameobject contains the following components:
I have already ensured that my Image component has "Raycast target" checked and that my Button component has "Interactable" checked.
Could this be because my Canvas' render mode is in screen space (camera)? I need the render mode to be set to this because I have 3D models that are added in front of the UI during gameplay.
Things I have already tried / checked:
Ensured that an EventSystem was present
Checked that another UI element wasn't covering the buttons, preventing a raycast
Ensured that the camera rendering the UI is above my main camera that is attached to the player. The rendering UI camera has a layer of 1 while the player camera has a layer of 0.
Your EventSystem GameObject is missing the Standalone Input Module Script component.
Select your EventSystem->Add Component ->Standalone Input Module. Done!
The gif below decsribes two ways to do that.
If anyone here ever runs into this problem and none of these fixes work, go to Edit > project settings > Input, then in the inspector tab click the little gear icon in the top right corner and click Reset. this should fix all your buttons!
Ensured that EventSystem component is present in the hierarchy. Without EventSystem unity is not able to track any events that's occurring in the particular scene
Try to change short order in canvas. Maybe the button canvas is blocked by another canvas.
If anyone here ever runs into this problem and none of these fixes work:
Chose your button in Hierarchy -> Find "Canvas" in Inspector -> Delete IT(Remove component)!
If you´re using the InputSystemPackage go to Edit > ProjectSettings > Input System Package. And in supported devices make sure there´s a Mouse option, if not, press the + button below and add the mouse device.
If you are pausing the game by setting the timescale to 0, then no input will work if the update mode of the input system is set to process events in Fixed Update, since the fixed update is not run at zero timescale - you can change the update mode in Edit > ProjectSettings > Input System Package.
Input settings screenshot
For me it was because the button was covered by other components in the Canvas. I changged put the button in the very front whithin the campus, and it works now
Please check for the "EventSystem" to be present in Hierarchy to make button working.
refer the attachment for it
I had this same problem in Unity v2020.3.24f1, and after trying all suggestions to no avail I noticed in my case the Graphic Ray-casting was un-checked. Just in case somebody tried everything and is still facing this issue, make sure it is ticked in the canvas element!.
Had a similar issue, my event system already had the Standalone Input Module attached and I apparently followed the warning and replaced it with Input System UI Input Module which broke mouse events. Adding the standalone Input module back isn't enough, the other input module must be disabled or removed. So try using the Standalone Input Module exclusively in your event system.

How do I trigger a CSS animation right before an element is destroyed?

I am trying to animate a drilldown menu, so that when the user clicks on one option, the sub-options expand in an animated way, and when the main option is clicked again, the sub-options will collapse with an animation too. The drilldown menu itself works, but the animations are giving me trouble.
I currently have the "expand" animation working correctly. When sub-option elements are created, they are given the class "drill-expand", that links them to the following CSS:
.drill-expand {
animation:expand 1s;
-webkit-animation:expand 1s; /* Safari and Chrome */
}
and a corresponding #keyframes animation. When the main option is first clicked, the sub-options are created, and appear according to the drill-expand animation.
But the problem arises in collapsing the sub-options. When clicking the main option to collapse the sub-options, I cannot get the sub-options to follow an animation. Instead, the DOM elements are just destroyed (correct behavior for the drilldown menu, but not pretty - I want an animation). Is there a way to trigger the 'collapse' animation, right before the DOM elements are destroyed?
I am working with AngularJS 1.1.4, if that can be useful.
Thanks!