Home Game Development unity – Increasing Recoil Over Time With ‘Diminishing Returns’

unity – Increasing Recoil Over Time With ‘Diminishing Returns’

0
unity – Increasing Recoil Over Time With ‘Diminishing Returns’

[ad_1]

I’ve a recoil system the place per shot, the recoil worth will increase. I would like the recoil to extend extra rapidly for the primary 10 or so photographs, then settle to a slower improve charge that then stays fixed.

I’ve one other worth, let’s name it “Damping”, which dampens display shake and such. This is required as a result of I’ve many different associated results like display shake which improve with the extra recoil there may be. The decrease Damping is, the extra it diminishes these results. So I want Damping to lower whereas recoil will increase. Unlike Recoil, I must regularly lower for the primary 10 photographs, then the speed of lower must get sooner.

The different challenge is that I want to regulate these curves relying on the weapons ROF. The decrease the ROF, the upper the speed of Recoil improve must be (and conversely, the sooner the speed of lower for Damping).

I can do all of it manually by multiplying recoil and damping by an element to extend/lower them per shot, and alter the charges of improve/lower for each x quantity of photographs, however that is clearly not excellent because it requires quite a lot of repetitive code and guide tweaking.

I’m utilizing Unity, C#. I’m doing all of the rising and reducing in void Update().

What form of formulation may I exploit to realize these two curves? I’ve tried trying to find “recoil curves” and checked out many tutorials for numerous recoil techniques however none actually apply to what I’m making an attempt to do or how my recoil works.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here