|
|
#1 |
![]() Join Date: Dec 2007
Reputation: 132
Posts: 618
|
Ironsight tutorial - model "jumps" on release of ironsights
I've been following the Wiki's ironsighting tutorial at https://developer.valvesoftware.com/wiki/Ironsights and it's all worked well, but I noticed that it caused the weapon not to do the usual drift when the view is rotated. To eliminate this (but to keep the non-drift while in ironsighted mode, so that the see-through side of the viewmodel doesn't drift in front of the view) I checked whether m_expFactor was 0 (ie. the weapon was not ironsighted) before calling CalcViewModelLag. That seemed to work but when m_expFactor then reaches 0, the weapon model pings off and then drifts back to the neutral positon. The scale of the ping seems to depend on the difference between the view angles of the player when the ironsighting was applied and removed. Is there a graceful way around this?
|
|
|
|
|
|
#2 | |
![]() Join Date: Sep 2010
Reputation: 0
Posts: 51
|
Quote:
Another way would be to try and make a duplicate function of the calcviewmodellag, name it something else, give the lag variables a much smaller value, and only call it when ironsighted. It would be a simple if else statement telling the game to call the duplicate weapon lag function only when ironsighted and call the regular one any other time. This would hopefully prevent that jumping since the model lag isn't going from an "off" to "on" state change which causes the jump in the first place. It would instead go from a smaller lag to a larger lag. I haven't tried this myself but it's worth a shot. |
|
|
|
|
|
|
#3 |
![]() Join Date: Dec 2007
Reputation: 132
Posts: 618
|
OK, thanks.
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|