When used for an attack, mortars move forward until they reach enemy troops to attack. The only structure a motar ever attacks is the castle gate. Towers are generally ignored, as are spikes and blockages. This can lead to a mortar having to stop and wait in front of a barricade or blockade. This is especially deadly if the opponent places spikes in front of a blockage. This would result in a mortar waiting in front of the blockage, whilst taking damage from the spikes in the meantime. Contrary to the 75% resistance to piercing the mortar obtains, it actually loses a decent amount of health.
Defending mortars behave mostly like other units: They travel towards the attacking forces and attack when in range. Compared to other units mortars are more likely to stop and move to the border of a lane to get in range of an enemy. Once a mortar shoots, the targeted unit or hero is affected, even if moves out of range.
Defensive mortars, apart from monks, are the only unit type to get targeted by an attacking cannon.
Mortars never panic; neither because of fire nor because of a werewolf's howl.