Skip to content

Instantly share code, notes, and snippets.

View NicklasSchell's full-sized avatar

Nicklas Schell NicklasSchell

  • Mainz
View GitHub Profile
@pppoe252110
pppoe252110 / WeaponSway.cs
Last active April 28, 2025 13:29
Correct Weapon Sway implementation which does not depend on fps
using UnityEngine;
public class WeaponSway : MonoBehaviour
{
[SerializeField] private Transform weaponTransform;
[Header("Sway Properties")]
[SerializeField] private float swaySmooth = 8f;
[SerializeField] private float swayDamp = 2f;
[SerializeField] private float posToRotAmount = 1f;