Attached actor shaking while being moved

Hi,

On click mouse down I spawn a “hollow” (translucent) version of a projectile at the muzzle point, where an actual flying projectile will spawn on mouse release. As my character moves, the attached actor moves with him, but it has a horrible shake to it. Maybe this gif will help me better describe my problem.

This project is based on First Person Shooter template. I spawn and attach the disc in C++:

HollowProjectile = SpawnHollowProjectile(HollowProjectileClass);
// Attach the spawned hollow projectile to FP_MuzzleLocation, keep relative and weld
HollowProjectile->AttachToComponent(FP_MuzzleLocation, FAttachmentTransformRules(EAttachmentRule::KeepRelative, true));
// adjust the location by an editable FVector
HollowProjectile->SetActorRelativeLocation(RelativeHollowLocation);

I tried updating the actor location in it’s own tick method, but the result was the same.

And this is the material I am using on the disc:

Does anyone have an idea why the gun, for example, renders smoothly, but the disk shakes?

Thank you!

Looks like motion blur. Does the problem go away if your remove motion blur or the post process?

Motion Blur is disabled in Post Processing volume. If I enable it, things get worse :slight_smile:

Hm. Maybe the texture coords are updating one or two frames behind the world render. If that’s the case maybe you can offset them by the delta rotation? Sorry I don’t know if I’m even close, I have very little Materials experience.

I think this behavior is due to the tick order of the actors: The Character is ticked before the projectile and the camera (angle and position) is part of that character. Then the projectile is moved producing the “shaking”. (I might be wrong on the particular order)

There are several things you can try:

  1. Don’t attach the projectile actor. Attach only projectiles’s mesh to the character and hide it the moment you fire (and spawn) the projectile. (simplest and most elegant solution)
  2. Change the projectile TickGroup so it is ticked before the Camera (Character). (might mess with physics/cloth)
  3. AddPrerequisite to the Character to tick after the projectile. (might produce input lag)

Happy coding

Hey dZh0,

Thank you for the answer. I tried changing the tick groups and it didn’t help. I also attached the static mesh to the camera, capsule, gun, … all with the same result. Even if I make the disc a skeletal mesh, and I attach it to the player character I still get the jittering movement of the disc :frowning:

Thank you for trying, but I’ve decided to find a different approach to the game.

That is… puzzling. Why would it behave differently than the FPS gun which is attached the same way?

Do you move/rotate the disk manually apart from a pure attachment?

Does it have physics turned on?

I have found the issue, it was the translucency of the material used. As soon I make the material opaque it all starts to behave splendidly :slight_smile: Right now I am not sure if this is a bug or the shaking is just a price for the translucent materials.

The cause seems to have been the translucency of the material used. As soon I made the material used for the disc opaque, the shaking stopped.

If you have a a way for translucent materials to be applied and no shaking is happening, I’ll definitely that select that as the correct solution :slight_smile:

Well, i might just resurect some dead posts, but for anyone landing here after some google search, you can keep your translucent materials. It’s just an issue you might had with motion blur.

In my case :

  • I just select my Post Process Volum in my Scene.
  • I Checked motion blur Amount and put it to 0.
  • You can also disable Motion Blur in Project Settings.

It fixed the problem i had so i hope it will help.

Using 4.25.4

PS : sorry for my english it’s not my native language.

1 Like

Beautiful this solved it for me.