right thing to do? if not, give an example to demonstrate your point. if so,

Question: if some action would produce more happiness overall than other possible actions, taking into account everyone who will be affected by that action, does that mean it is the right thing to do? if not, give an example to demonstrate your point. if so, explain why