can I stop actor from going at an angle?

I have an actor that goes in 4 directions with left, right, up, and down.
When I press up and right it goes in a north east direction. I was thinking of only using 4 directions instead of 8, If I wanted to do this how would I stop it from going at an angle?
When I press up and right it goes in a north east direction. I was thinking of only using 4 directions instead of 8, If I wanted to do this how would I stop it from going at an angle?