using System; using UnityEngine; public class PickupBounce : MonoBehaviour { public float floatStrength = 0.1f; public PlayerController.PickupType type; private float _originalY; private void Start() { _originalY = transform.position.y; } void FixedUpdate() { transform.position = new Vector2( transform.position.x, _originalY + ((float) Math.Sin(Time.time) * floatStrength) ); } }