Litter Box Problems
Going outside the litter box is often due to the box, litter type, location, or not enough resources in a multi-cat home. Trees and perches give cats room to spread out, easing competition that can contribute to box avoidance.
This is different from spraying, a separate behavior used for communication or driven by stress. Medical issues are a common cause too, so consult your vet first.