x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

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.alt text

Product Version: UE 4.13
Tags:
speed bp.png (547.8 kB)
more ▼

asked Dec 22 '16 at 02:00 PM in Blueprint Scripting

avatar image

Amdirant
1 1 2 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Dec 22 '16 at 03:53 PM

avatar image

saeedc
2.3k 72 40 105

avatar image Amdirant Dec 23 '16 at 04:59 PM

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.

alt text

fly bp.png (524.1 kB)
avatar image saeedc Dec 23 '16 at 05:10 PM

you need to plug axis value in scale value.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question