New answers tagged

1

As it was not clear to me in the documentation I am exposing the answer here: You can use DOShakePosition(float duration, float/Vector3 strength, int vibrato, float randomness, bool snapping, bool fadeOut) Shakes a Transform's localPosition with the given values. This configuration worked for me: transform.DOShakePosition(2.0f, strength: new Vector3(0, 2, ...


0

The method Input.GetKeyDown only returns true during the one Update where the player starts pressing the key, but not on the following updates where they hold it. I would assume that your intention is to display the running animation while the player is holding down either A or D, and stop it when they are holding neither A nor D? In that case you might want ...


2

the accuracy should be in 1-2ms intervals You are out of luck here, getting high and steady frame-rate in WPF is impossible by design. Still, you can get decent 60Hz, and anything above requires high-frequency display anyways — I expect those to be rarity in a business environment. I am planning to use writeable bitmap 800x40px. D3DImage should be a ...


1

When you use the animation time-line, Unity will automatically disable the animator component, even if you aren't trying to modify it. Try implementing the animation and then seeing if it will work.


0

To make physics affect rigidbody after playing an animation we can disable an animator. One way to do that is through the animation event which would call a script, which would disable the Animator: //get an animator instance in any way //e.g. through a property or through the .GetComponent<Animator>() animator.enabled = false; Another way is to ...


2

Put the animated GameObject inside another GameObject. So for example, you have a prefab named "Coin" with a child inside it named "Coin Mesh" or something like that. Then you can animate the mesh's local position within its parent, without it disrupting the coin's world position. It's also generally a good idea to delete keyframes for ...


1

The reason this happens is that you didn't tell Unity where you wanted the animation to start, because you had no keyframes on the foot position property until the one you created at 0:40. So Unity assumes you want the movement to start at the start of the animation. Keyframes are handled independently for each property, so having a keyframe on a different ...


1

This is caused by the Animation window's automatic easing curves. At the bottom of the animation window there are two tabs, "Dopesheet" and "Curves". In the "Curves" tab you can view or edit the smoothing/easing curves. Switch from bezier to linear if you don't want this type of side effect to occur when you edit a keyframe. ...


2

You can add a script that draws a gizmo along this line. Here's an example: public class ColliderVisualizer : MonoBehaviour { public EdgeCollider2D edge; public Color32 color = new Color32(255, 0, 0, 255); public void OnDrawGizmos() { if (edge == null) return; Gizmos.color = color; var points = edge.points; ...


2

One way to do this would be with animation layers. Create a new layer in the animator window and give it an avatar mask that only uses the upper body. That way, when you play an animation that layer the feet will not move


0

Storing all frames from every image as one large image allows for the hardware to use the same material/shader/texture for every animation and avoids context switching. Then it's just a matter of calculating a frame's bounds in UV space (or pixel space if the graphics library you're using doesn't support UVs) given a frame index or its coordinates.


Top 50 recent answers are included