Wednesday, September 21, 2022
HomeGame Developmentunity - Growing Recoil Over Time With 'Diminishing Returns'

unity – Growing Recoil Over Time With ‘Diminishing Returns’


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 enhance charge that then stays fixed.

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

The opposite difficulty is that I want to regulate these curves relying on the weapons ROF. The decrease the ROF, the upper the speed of Recoil enhance 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 enhance/lower for each x quantity of photographs, however that is clearly not very best because it requires plenty of repetitive code and handbook tweaking.

I am utilizing Unity, C#. I am doing all of the growing and lowering in void Replace().

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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments