Mesh component jitters on rotation

First time that this started to occur was on a transition from engine version 4.8 to version 4.9 and it persisted to 4.10.

I have a character actor with camera that is controlled by mouse input (just like in default c++ fps project), but actor rotation does not follow the rotation of the camera. Actor is rotated only when yaw difference between camera and actor exceeds some value (30 degree angle, for instance), but that is irrelevant in this matter. There is a mesh component on this actor that should match the camera rotation. The problem arises when I try to set the rotation of this component in blueprint’s Tick() function, so that components yaw matches yaw calculated from mouse input. This setup causes mesh to jitter, like so:

http://www.filedropper.com/rotationblueprintmpeg4

If I instead set the rotation of this component in the same manner but in c++ Tick() function, there is no jitter:

http://www.filedropper.com/rotationcmpeg4 .

This setup is just for testing, my problem was with jitter while trying to rotate a bone in animation blueprint, but I narrowed it down to this. I suppose that it’s some kind of a timing issue, where Tick() in c++ fires before render update (I suppose) and blueprint Tick() fires after or something similar.

Also, in the same time when this started to happen camera started to shake while using flythrough mode in editor viewport:

http://www.filedropper.com/editorjittermpeg4

It might be related, so there you go.

Hi Ebb Software 3,

I made some real quick tests to try to reproduce what you described, but I was unable to do so. Would it be possible to see the portion of your Blueprint that is related to rotation, as well as the code you use to do the same thing?

Hi , thank you for your quick response.

After your comment I tried to reproduce this effect in a new project. Here is a link to the project:

Test project files

I created a fresh project with c++ first person template. All changes in c++ are in AJitterTestCharacter class. Also, please take a look at FirstPersonCharacter blueprint because it is modified too.

There is RotateInBlueprint flag which switches between mesh rotation in blueprint and rotation in c++. UseControllerRotationYaw is set to false for FirstPersonCharacter, and FirstPersonCameraComponent has its UsePawnControlRotation set to false. The idea is to rotate camera purely by mouse input and make Cube (the aforementioned test mesh) match the yaw of the camera component.

Match rotation by stored camera yaw.
In the event graph, in this setup there is no problem; the mesh rotates without any glitch. Setting the RotateInBlueprint flag to true or false makes no difference.

Match rotation by current camera component yaw.
This is where it gets funky. If RotateInBlueprint is set to true, and we set yaw of the mesh component from camera component’s current yaw (like in the picture), jitter starts to happen. If we set RotateInBlueprint to false, everything is ok again, there is no jitter.

I will probably find a workaround, as I begin to suspect that the way that my camera’s rotation is being updated is responsible for this and with a little bit of tinkering that should be resolved. It just puzzles me that it started to happen when we switched to 4.9 and nobody reported anything similar, to my knowledge at least.

Thank you for providing a sample project. Using that project, I did not see a large amount of jitter, but I did notice some significant lag when moving the mouse rapidly and updating the cube’s rotation using the camera component’s rotation. I believe this is due to the camera component’s rotation being updated after the scene is drawn, so it seems as though there is about a one-frame delay. I looked through the update notes for the last few versions and didn’t see anything that would indicate a change in this area, so I’m not sure why you would suddenly start to see this behavior in 4.9. Unfortunately I won’t be able to get much more insight into this until more of the developers get back from the holiday break.

, thank you for your effort. After reading your comment I reverted the sample project to 4.8 and the behaviour persists there, so it’s really confusing. Maybe the lag observed in the sample project is not related to my original problem after all. I’ll have to experiment more to figure this out.

Hi,

I just wanted to check and see if you had an opportunity to experiment with this issue some more. One suggestion to consider would be to try using FXAA if you are not already doing so.

It turns out that the problem with jitter was specific to my project. The camera and actor rotation has been updated in actor’s Tick() function, while setting the rotation of a bone in animation blueprint to match the camera’s rotation via “Transform Bone” node. Once I relocated the camera and actor rotation logic in input handler function (for “Turn” input axis) everything returned to normal and there is no twitching and jittering.

Now, I guess the former setup was ok in Unreal 4.8 somehow but on 4.9 this became unstable because of some change of the way the animation updates. So now the latter setup works because it always executes first (before actor’s Tick() and animation update). Either way I’m happy this problem is resolved. :slight_smile:

Thank you for your help!

Milan

Been searching all over for this. Why is it so obvious AFTER you find the solution? :slight_smile: Thank you!

i think this could be what can save my project too… do you have some images you can share… with how you solved the problem. I also have some jittering and my Head Bone is rotated from a variable set in my Actor Bp… Looking forward to your reply!