If intention is one of the conditions necessary to complete an action, whether virtuous or non-virtuous, then intention does play an important role because it will produce an effect similar to the cause. For example, if we do something with evil intention, the effect will come back to us.
There are ten non-virtuous actions and ten virtuous actions. To complete an action, certain conditions are necessary, but intention is not always one of the conditions. An immoral action that requires intention as one of its conditions is killing. To complete the offence of killing, five conditions are necessary, viz.: a being, consciousness that it is a being, intention to kill, effort of killing and consequent death. An action that does not include intention as a condition is wrong view. To complete this wrong view, two conditions are necessary, viz.: perverted manner in which an object is viewed and the misunderstanding of it according to that view. In the case of wrong view, intention does not play a role in the action of having wrong view.
So, intention plays a role, karmically, only if it is one of the conditions necessary for the action to be completed.