Weapon Aim Down Sights(First person aiming) being messed up when combined with an animation

wavey
Hey all!

IMPORTANT

So I have this FPS shooter i made, that uses a standard gun animations(e.g. Idle, Reload, Shoot, etc.)
Now this is used for third person. I handle the first person with replicating all character movements (In my case only the arms and gun) to the viewmodel by simply copying the M6Ds’ Transforms from the character to the viewmodel. This is how its done.

-- Apply Shoulder Transformations to ViewModel
	VM.Torso["Left Shoulder"]["Transform"] = leftShoulder.Transform
	VM.Torso["Right Shoulder"]["Transform"] = RightShoulder.Transform

DICTIONARY

  • “VM” stands for Viewmodel
  • “leftShoulder” and “rightShoulder” are just the character’s m6ds (NOT THE VIEWMODEL)

Ok i wont go into much detail on how it attach the GUN to the viewmodel, since i dont think it will be important

Enough on that

So This is my issue currently:
My system features first person ADS (Aim Down Sights).

I handle the in a standard way using this piece of code here

	aimPos = aimPos:Lerp(
				SManager.currentTool.AimPart.CFrame:ToObjectSpace(VM.Head.CFrame * offset:Inverse()), 
				.3 * DT * 60
			)

DICTIONARY

  • “VM” stands for Viewmodel
  • “offset” is just a cframe value i use for any modifications made that might mess up the ADS - ignore it
  • “DT” - deltaTime

Once the aimPos is calculated, i simply apply it to the viewmodel via a RenderStepped loop - the standard way of making viewmodels

Nice, it works perfectly fine. UNTIL NOW!!!

See, i also want the player to look like they are aiming when they are in third person. This can EASLY be achieved by just playing an aiming animations. This is how it works in game:

Nice, it works great, but lets take a look at first person :frowning:

THE VIDEO QUALITY IS REALLY POOR. IN GAME - NEAR THE END OF THE AIMING THE GLITCHING IS LIKE 3X TIMES MORE INTENSE

As you can CLEARLY see, the lerping and aim animation for third person are overlapping, which is causing issues such as flickering(not noticable when recording), and an exaggerated movement at the end of the Aiming

Now here are potential solutions that you MIGHT or might not recommend, that wont work:

  • “Why don’t you just only play the animation when in third person”

Well i could, but if i stop the aiming animation track, other players around me wont be able to see me aiming

  • “Why don’t you just exclude this animation track from the viewmodel”

A great idea, but it sadly wont work cuz my system, as i showed above, “hardcodes” the movements aka it doesnt replicate the animation tracks, instead it directly replicates the character’s M6Ds’ C0s and C1s to the viewmodel (too many Ss lol)

Final words.

I don’t even believe if this bug - especially in my specific case has a fix, but as always ANY help is appreciated, thx a lot for reading through this textbomb, and have a nice days!!!

2 Likes

are you seriously using an animation?

3 Likes

ah nevermind. i dont see an issue but could you clarify what you mean by “down animation being broken”

I would suggest considering re-reading the topic, but anyway what i meant was that jitter/jump at the end

Also the animation is only for third person, but still affects the viewmodel

are you using elastic? if so then use something else. in the down animation i think you used elastic which makes it a jump, use something else like exponential out

The issue is not with the animation. The issue is that the lerp AND animation are overlapping

could you perhaps show the animation raw without all the lerping overlap

are you making the camera to the humanoid or the head?

Well idk how that will help, but the camera’s subject is the humanoid

Are you running the lerp and the animation at the same time? Try separating them if this is the case. I may be wrong as I don’t have much experience with this kind of work but just a suggestion.

i think the head will make the camera follow and misalign it

Instead of using transforms on the ViewModel to copy the 3rd person animations, you want to have separate animations for the ViewModel that play alongside the 3rd person ones, and exclude the Aiming animation.

Considering your ViewModel looks similar to the standard player rig, I doubt there would be any issues just duplicating the Animation Instance and AnimationTrack and having it play seperately on the ViewModel.