Animations brokes when adding aim offset to character - unreal-engine4

I have a anim bp in my game, inside here i have something like that:
My anim graph:
I want to make an anim offset. I creted the animations for that and i set the animations additive type to local space (and i also tried mesh space, and all the other options) and then selected anim frame
If i plug then UpperBody directly to then blend per bone it works normal but of course without the aim offset.
but if i add the AO_Amy to the Blend Pose 0 i'm getting this:
I don't know what i'm doing wrong, i'm working on this for 8 hours now and i can't find any tutorial or solution for this problem.
I followed many tutorials but i all shows the same thing that i'm doing and i want to find a solution as soon as possible

Related

Control Rig axis are broked

I want to make my character aim using control rig. But for some reason my character are rotating in the wrong axis and i don't know why.
I tried change the axis (primary and secondary) to some random values but i can't get it to work and i watched also a lot of tutorials and i don't think that i'm doing something wrong.
My control rig
My Character BP (SETTING THE AIM AT VARIABLE):
My anim BP:
THE RESULT:
Try setting the scale of your character as per the requirements of UE4.
You can refer the UE4 Documentation for the scale measurement
Make sure that you have correct parameters such as meters or centimeter in order to sync your base model with your correct paramters.
You can also try an addon of import rig from blender to UE4.

Unity: skinned mesh vertexbuffer output slightly different than correct results

It’s like this hip is stuck in place, with in the pictures(being at different times in the animation since I can’t upload a gif) the red wireframe is the drawing of the raw output triangles and everything else being default unity, aka the correct output
What am I doing wrong? What am I missing? This has been driving me nuts for 2-3 days now, any help is appreciated
As you do not post any code, I will try to do some guessing over what is going on. Disclamair: I actually happen to run into similar problem myself.
First, you must know that Update's of MonoBehaviour are called in random order (not neccessery random-random, but yous see the point). If you bake mesh in one component, it can still be one-frame late to the Animator component.
There are actually two solution of this case: first is to specify the order of Script Execution Order in Project Settings, while the second is to use LateUpdate instead of Update when updating mesh after skinning.
The second problem you might have run into is scale / position of skinned mesh. Even if it does not contribute at all to the animation movement it can still wreck the mesh baking collision later on.
To fix that make sure that all your SkinnedMeshRenderers objects have Local Position, Local Rotation and Local Scale set in Transform component to identity (0,0,0 for position and rotation, 1,1,1 for scale). If not - reset those values in editor. It will not change animations, but it will change mesh generator.
If both solutions does not work, please describe the problem more thoroughly.

Flare/Flutter: How to reset the progress of an animation before starting it?

I have a Flare file with 3 animations contained within it, all in the same artboard. I understand that when switching between animations, Flare will mix the animations together by default, and that playing one animation will not reset the relevant nodes values back to what they were on frame 0 in the editor. That is the behavior I would like to achieve: when playing a new animation, I would like the previous animation to stop completely (don't mix them at all) and for the incoming animation to start at the very beginning with all its default values.
The use case is this:
Play an animation where, say, the opacity of a shape goes down to zero
Play a different animation that uses the shape from above, but in the Flare editor its opacity is 1 at the start of the animation
Desired result: the new animation resets the opacity of the shape and then begins and plays like normal
Actual result: since the previous animation changed the shape's opacity, the new animation will use the shape how it is instead of how it was created in the editor
For my question as explained on GitHub you can look at the end of the thread on this issue (has gifs): https://github.com/2d-inc/Flare-Flutter/issues/14
In the above thread, Luigi Rosso mentions "re-instancing" the artboard. Does anyone know what he means by this and how to do it? I have tried several methods of doing this such as the makeInstance methods found on classes such as FlutterActorArtboard, ActorNode and some others (there are a few variants of the makeInstance method but they are all similarly named and return a new artboard. However, I had no luck with replacing the current instance of my artboard in a FlareController implementation so far.
I have also tried to manually loop through all of the ActorNodes of the artboard and first saving their initial values and then copying the saved values to the artboard every time a new animation is played, but this seemed to break things pretty badly (the animation was unrecognizable and just didn't play correctly after that, so I must have done something wrong. Or I'm resetting the wrong values).
Any help is appreciated, thanks!
For playing a different animation on a shape and resetting its opacity, you can access the opacity of the node at runtime with:
ActorNode myNode = _artboard.getNode("nodeString");
myNode.opacity = 0.00;
As outlined here in the manual.
More simply, in the new animation, you can set a keyframe in the Rive/Flare editor for the opacity to be 1 at the start of the new animation, so that when it plays the animation from the beginning its opacity will be reset to 1.
For playing one animation, then overriding it completely when the next animation plays you can extend the FlareController and create a custom animation controller to do this in the advance method.
Here's a quick and dirty example (not best practices) to give you an idea of using advance:
https://gist.github.com/she-who-codes/85d8f0da97abfc3ecc43b1cb470e9c29
https://gist.github.com/she-who-codes/ce633204cd2d4babfe9a5b54e34ca63d

Making multiple objects with the same shader fade at different times

I have a death transformation for one of my GameObjects which goes from a spherical ball to a bunch of small individual blocks. Each of these blocks I want to fade at different times but since they all use the same shader I cannot seem to figure out how to make all of them not fade out at the same time.
This first picture is the Spherical Ball in its first step for when it turns from a spherical ball to a Minecraft'ish looking block ball and to the right of it is one of the blocks that make up the Minecraft'ish looking ball shown by the red arrow.
Now this is my Inspector for one of the little blocks that make up the Minecraft'ish looking ball.
I have an arrow pointing to what makes the object fade but that is globally across all of the blocks since they use the same shader. Is it possible to have each block fade separately or am I stuck and need to find a new disappear act for the little block dudes?
You need to modify the material property by script at runtime, and you need to do it through the Renderer.material property. When you access Renderer.material, Unity will automatically create a copy of the material for you that is handled separately -- including getting its own draw call, if you care about performance. You can tell this has happened because the material name in the renderer will change to "Materialname (Instance)".
Set the material's fade property using Renderer.material.SetFloat() (or whatever the appropriate Set... function is). Unfortunately the property's name isn't "Fade Factor". You can find the property's name by looking at the shader script, or by switching the inspector to debug mode and digging through the Saved Properties array for one that looks right.

Unity - Avoid quad clipping or set rendering order

I am using Unity 5 to develop a game. I'm still learning, so this may be a dumb question. I have read about Depth Buffer and Depth Texture, but I cannot seem to understand if that applies here or not.
My setting is simple: I create a grid using several quads (40x40) which I use to snap buildings. Those buildings also have a base, made with quads. Every time I put one one the map, the Quads overlap and they look like the picture.
As you can see, the red quad is "merging" with the floor (white quads).
How can I make sure Unity renders the red one first, and the white ones are background? Of course, I can change the red quad Y position, but that seems like the wrong way of solving this.
This is a common issue, called Z-Fighting.
Usually you can reduce it by reducing the range of “Clipping Planes” of the camera, but in your case the quads are at the same Y position, so you can’t avoid it without changing the Y position.
I don't know if it is an option for you, but if you use SpriteRenderer (Unity 2D) you don’t have that problem and you can just set “Sorting Layer” or “Order in Layer” if you want modify the rendering order.