Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

CS:GO-like recoil

$
0
0
Hi, I am trying to make gun spray pattern recoil like CS:GO. I was thinking maybe I can cycle through a Vector3 Array. But I Don't know how to lerp from one Vector3 to another to another I was thinking doing something like public class Recoil : MonoBehaviour { public Vector3[] sprayPattern; public float speed = 5f; public void Recoiling() { Vector3.Lerp (sprayPattern [0], sprayPattern [1], speed); Vector3.Lerp (sprayPattern [1], sprayPattern [2], speed); Vector3.Lerp (sprayPattern [2], sprayPattern [3], speed); } } And I would call the Recoiling() Function in my weapon Script. But Then I was thinking, what if I have more than 4 Vector3s in my array. Essentially, I need help getting a spray pattern like CS:GO Oh and, animations won't work for this.

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>