# How Do I Move the Player Character on the Z Axis On Button Press?

**URL:** <https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993>\
**Category:** Character & Animation\
**Tags:** actor-blueprint, unreal-engine, z-axis, Blueprint, question\
**Created:** [December 22, 2016, 2:00pm UTC](https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993 "2016-12-22T14:00:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amdirant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amdirant](https://forums.unrealengine.com/u/Amdirant)\
**Post date:** [December 22, 2016, 2:00pm UTC](https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993/1 "2016-12-22T14:00:06Z")

</div>

Hey there,

I’m making a side scrolling shooter (not a platformer), and i want to make the character move vertically when the up or down key is pressed.

I’ve tried doing it by “set speed” - this makes the actor move upward from the start of the game, and by “set actor location” - this appears to not work at all.

I’m not great at blueprints but I hope someone can help.

 ![119613-speed+bp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/6/2169cf143931539756f70cb3a7d29f867ca138d5.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_277c86b9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_277c86b9](https://forums.unrealengine.com/u/anonymous_user_277c86b9)\
**Post date:** [December 22, 2016, 3:53pm UTC](https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993/2 "2016-12-22T15:53:33Z")

</div>

You must first change its **movement mode** to **flying mode** from its **movement component** then you can use **add movement input** node to move it up and down.

set an input key from project settings then use its event to add movement input. for example W =1.0 and S= -1.0

---

<div class="post-metadata">

**Author:** ![Amdirant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amdirant](https://forums.unrealengine.com/u/Amdirant)\
**Post date:** [December 23, 2016, 4:59pm UTC](https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993/3 "2016-12-23T16:59:39Z")

</div>

Thanks for the help. At the moment, it starts moving down as soon as the game starts, and continues that way.

The “input axis move down” event is the down-arrow or “S” key being pressed, in the image below.

 ![119757-fly+bp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/3/2e336d2ea2937c8cdd522e4e293cb152d69ba4e9.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_277c86b9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_277c86b9](https://forums.unrealengine.com/u/anonymous_user_277c86b9)\
**Post date:** [December 23, 2016, 5:10pm UTC](https://forums.unrealengine.com/t/how-do-i-move-the-player-character-on-the-z-axis-on-button-press/379993/4 "2016-12-23T17:10:10Z")

</div>

you need to plug axis value in scale value.
