You have to add a collider and a rigidbody to your gameobject. Disable "UseGravity" and "IsKinematic". Under constraints set all rotations to freeze.
Attach a script that simulates the physics you want. For example:
public class Bounce : MonoBehaviour { private Vector3 _initialPosition; private Rigidbody _rigidbody; void Start() { _initialPosition = gameObject.transform.position; _rigidbody = GetComponent<Rigidbody>(); } void Update() { var force = 50 * (_initialPosition - gameObject.transform.position); var damping = -5 * _rigidbody.velocity; _rigidbody.AddForce(force + damping, ForceMode.Force); } }This will apply a force to your object when it is pushed out of position to move it back. The damping is needed to prevent infite oscillation. You have to tune the factors for force and damping to match the weight of your object and the weight/force that pushes your object out of position.