Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation Issue #3539

Closed
DerpyHoowes opened this issue Nov 27, 2022 · 14 comments
Closed

Animation Issue #3539

DerpyHoowes opened this issue Nov 27, 2022 · 14 comments

Comments

@DerpyHoowes
Copy link

I made a set of custom animations for my gun, and there's a problem with it: Sometimes when you aim, the sight shifts off the screen center for some reason. Usually re-equipping the gun helps, and this whole issue appears randomly. What could be causing it? Could it be something with my animation or is it some in-game glitch? Also one weird thing to point out is that deviation angle is always different.
изображение
изображение
изображение

@prank0079
Copy link

prank0079 commented Nov 27, 2022

You must adjust the "right _ hook" so that the gun is directly in front, because aiming only transfers the position of the lens to the sight, not including the angle.
image

@DerpyHoowes
Copy link
Author

Well the Right_Hook is angled properly, I even used rotation constraint copying rotation of an empty object in the scene to generate keyframes. So this shouldn't be the case. Also if it was angled wrong, why would this problem appear randomly? Because sometimes its angled properly, and sometimes its not.

@prank0079
Copy link

I'm sorry, I don't know that. I've never met this kind of situation.

@SDGNelson
Copy link
Member

Maybe the end of the aim animation is off by one frame? The final frame of the aim animation should have the gun parallel with the camera direction.

@DerpyHoowes
Copy link
Author

DerpyHoowes commented Nov 29, 2022

Well, I dont know, it seems to be in order to me. The Aim_Start animation is the first in NLA export timeline and lasts from frame 1 to 15. And in the unity it is set accordingly.
изображение
изображение
Also for the experiment I applied Aim_Start rotation to preview, put the gun in Right_Hook's children just like it is in the game, skipped to the last frame of animation and dragged it out of the preview hierarchy, and as you can see in its coordinates, and its completely parallel (well maybe there are some numbers after the comma, but I dont think they're big enough to affect it)
изображение
And still, if the animation was just wrong, why would it be random in its deviation? People are sending me screenshots where their scopes slide left, right, over and under the screen center. It seems to be completely random.
I first thought that inertia could be causing it, so I turned it off, but the issue is still present.

@DerpyHoowes
Copy link
Author

My friends also tested out the mod today, and noticed several details about this glitch: The model seems to slide towards the direction you're moving in. So when your character walks around, his arms slide left and right, and if you aim while the arms move to the left, the aim also seems to shift to the left and so for the right side. If you aim while prone hands with gun slide towards the top of the screen. Also movement caused by Shake parameter seems to affect the direction in which the viewmodel shifts.
So it all seems somehow connected to the scripted movements of viewmodel. What mistake could I make to cause such problem? Im actually clueless, since I dont know much of how camera and viewmodel work, but maybe I have some unwanted keyframes or something?

@DerpyHoowes
Copy link
Author

Unturned.2022.11.30.-.03.13.10.05-1.mp4

@prank0079
Copy link

prank0079 commented Nov 30, 2022

I seem to know the reason. It may be: when using the "Equip" action to take out items, the subitems in "Item" will not be generated immediately, but will actually be a little slower.
Before exporting actions, use constraints on "Base" bones and link "Right_Hook". Will it improve?

@SDGNelson
Copy link
Member

The automatic sight alignment could benefit from some improvement anyway. I will put it on my to-do list.

@DerpyHoowes
Copy link
Author

prank0011, instead of trying your suggestion I first decided to try make a gun with the same animations but no animated parts, so essentially a vanilla type static gun mode with mesh filter and mesh render, and the aiming problem still occurs. So its not about the moving parts, something is wrong with animation itself. Could the fact that I dont export keyframes for Skull, spine and legs cause they arent being moved by gun animations the reason? Like, maybe the skull moves in a wrong way or something, cause I cant find a proper explaination of why this happens.

@prank0079
Copy link

I tried it, but it didn't trigger the Bug.Can you share the 'Equip' animation file?
QQ截图20221204000539

@DerpyHoowes
Copy link
Author

Turns out its not the Equip animation causing. First I tried to replace equip animation with vanilla one, but the issue was still present. Then I did the same with aiming animations and it fixed. So the problem is caused by something in aiming animations.
Can you give me your discord nickname or maybe some other contact, so I can send you the animation file privately?

@prank0079
Copy link

My discord username is prank#0079, or you can send it to my email: 1010124811@qq.com, thank you very much!

@DerpyHoowes
Copy link
Author

Actually I've found a way to fix it! Turns out this was happening because I didnt export all bones keyframes, only the ones I moved. I dont know what does that have to do with camera snapping to the wrong position, but at least it fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants