View model springs - How to get it right?

denisfrs

Member
Hi :)

I'm trying to wrap my mind around all the "springs system" and how to tweak properly for what i need to achieve, but sometimes i still struggle to get things right.

For instance, i have two guns in my game.
  • One gun the 'aim down sight' is perfect fine, the gun move from where it is to the center of the screen, but it does very slowly (for a fast paced FPS)
  • The other gun move from where it is to the center of the screen with the right amount of speed, but surpasses the center of screen and go back to the center (where suppose to be)
I can change this by tweaking the differents "Stiffness" and "Damping" values, but i never get it right (Check out video below).


My question is, how i can get both of things, make the weapon aim faster but 'lock' in the center of screen without surpassing the position is suppose to be?



EDIT: I kind solved this issue, read below

Before, the guns had different parameters to set the position of the weapon.
The 'idle state' was using position / rotation offset while the 'aim state' was zeroing those values and setting the Pivot position / pivot rotation offset to place the weapon where it should be.
It seems that between state change these different parameters was causing the overshooting problem.


About the "aiming speed" @ChristianWiele was right, setting the stiffness to zero was a good start point to tweak that.
 
Last edited:
Well, this is the classic undergraduate physics question: What't the optimal spring, and damping values for a door to quickly close without overshooting ... :cool: Unfortunately, we don't provide the solution, so you have to figure it out yourself. The quickest way is to set the stiffness to zero, and then increase the damping until it starts overshooting.

For the assault rifle I tried it on the demo scene. If you set the stiffness to zero, and the damping to about 0.3 you get a pretty quick aiming with only minimal overshooting.
 
Thank you @ChristianWiele, you pointed me in the right direction.

I figured out what was really causing the overshooting problem and edit my first post in case someone bump into this.
 
Top