How to move an object with WASD?

Hello everyone, I was wondering how I could simply add or subtract to the X or Y variables of an object when clicking a certain key. I’m trying to program a game with C++ instead of using the blueprints as I prefer to program.

I’m looking for something like this

if (w key){
player.xposition += 1
}

You can use the character movement component for that and it brings a lot functionality with it. If you really want to keep it simple you can override tick and check there if a key is down add world offset in a certain direction.