Hello,
I was trying to create a little recoil system as in the one used in CS:GO
I got a primary result with using the add controller Pitch/Yaw input but it was completly random
Hi,
Use tick and node “random unit vector with yaw and pitch” (i dont remember exactly name of that node)
In every fire input, increase float variable and plug that variable into pitch and yaw, with this you will shoot in random circle, set ofc some clamp value to that float and in tick continuously decrease that float value. If you want recoil to put your crosshair up, add pitch input to controller… (imo 10x pitch and 1-2× yaw for more realistic recoil.)
You need a three dimensional plot of some sorts, where one of the axis is time. The other two axis would represent the amount of recoil in X and Y directions.
Nonono.
If I was you, I’d put your spray Pattern in a curve (Vector/2D Vector).
Store it in your weapon.
In your player, store a variable called “recoil”, preferably a float in [0,1]
In your weapon, store a variable called "recoil falloff " again as a float in [0,1].
In your weapon, also store a variable called “recoil effect”, preferably [0,1/amount of bullets in round]
In your player Event Tick, “recoil” is decreased by recoil falloff of your currently equipped weapon.
Whenever the player shoots, get the position from your recoil curve with your current “recoil” and add “recoil effect” of your weapon to the current “recoil” of the player.
Add the value from the curve at the specified position to your player View
This is an idea I came up now. It certainly is not the CSGO-Spray algorithm, but it’s a start…