Is there any way that I can have two separate animations control a single part (one animation rotates the object, the other animation positions the object). I have tried doing this, but they overlap in the way that the one that’s supposed to handle only rotation also affects the position and vice-versa. I have also tried messing with priorities, but it didn’t change the outcome.
I posted about this a bit ago, but I think I spent too much time explaining irrelevant things, so I’m asking more concisely this time
Any help is much appreciated.
Is there any code that we can see? Maybe i can help you.
There isnt really any significant code related to this, but for more detail I have a gun viewmodel that I have two animations for. One animation makes it so that the gun rotates back and forth slightly to add an effect of elasticity after firing the gun. This animation only rotates the gun and does not change any position values during the entirety of the animation. The second animation moves the gun, but it only handles position values, not rotation. I was wondering if I could have the animation that handles rotation and the animation that handles position play at the same and affect the same part on the viewmodel.
1 Like
Yes, you can combine the two if you want. I would recommend combining both animations. Also, if the gun moves while the rotate animation is playing, there is most likely a problem with the welding or the offset of the rotate animation and vice versa (may not be).
How you can do is, get both animation and put them together in animation editor(i don’t know what you’re using) and try to play with them. The only thing that you need to do is weld the same part welded correctly. And offset. I recommend weld constraint or Motor6d.
I don’t know if it satisfied you,i may be talked nonsense, but if it works, I’d be happy. There is video that i like if you want to check: How to ANIMATE TOOLS | HowToRoblox - YouTube
here the guy makes with motor6d. Thats all i know.
THanks, but I meant having the animations play separately but affect the same part differently. One animation plays the rotation and another plays the movement, but I don’t think there is a way of doing this. I am looking at trying to manipulate some linear interpolation to have a elastic style instead so I can eliminate the need for two animations
Oh, you can’t sadly. But you can use something like tween or lerp the object for linear interpolation or the elasticy that you need. You must know elastic property in easingstyle (tweenservice). You can use that.
Unfortunately I can’t use a tween as if I tween the viewmodel, it wont follow the camera since any change of positions are not updated to the tween
Can i ask what do you want to make the animation for viewmodel? Like, follows the camera or recoil or reloading or if another object then what it is. Also what do you mean by elasticity? As i said it changes by what do you want to achieve.( Sorry for asking too many questions. Im trying the best i can )
You’re fine, thanks for helping out. I am trying to implement the two animations on the same object in the viewmodel (the base part of the gun in the viewmodel), but overlapping them creates some issues.
Below is a video of the gun firing without any added elastic effect.
This is alright, but I want to spice it up a little bit by adding the extra animation for the elasticity of the movement of the gun after firing. The following is the animation of the elasticity of the gun (Note that it doesn’t deal in changing positions, only rotations):
Putting them together, no matter how I mess with the priorities, I get something along the lines of this:
I imagine this is because even if you only change the rotation of an object, it is still animation the position as well, and vice-versa.
If you want the gun to recoil, you have to recoil the gun with your hands. You have to weld the gun to the hand. I’m going to talk like you have welded. In real life, when a gun recoils, the gun does not recoil on its own. Kicks from the point where the gun is fired up to the elbow joint. Energy is flowing through your arm. So what you want to do is animate (rotate) the hand like in the first video. And move the arm towards to the camera (position). The problem may be is that you need to weld the gun to the both arms, not just one (at least in zoom). You may have welded on both arms. Then you just have to play with welding offsets to orient the gun even(in the middle of two arms). I also wrote some info because it could be the problem (unlikely). You can move and rotate the gun, but you need to move or rotate the arms to be elastic.