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"

PlayerController - InputAxis firing continuously

Hello all,

Quick question, I'm making a PlayerController to handle Input (Action event and Axis event). Found that the Axis event fire continuously like a tick event instead of when axis input is change (Axis event, as it work if I handle it from my character BP)

Why is that ? How to not ?

Log on screen keep adding "0" if axis doesn't change, or "-1" / "1" if it does.

Thx ya all

alt text

Product Version: UE 4.15
Tags:
screenshot_82.png (81.5 kB)
more ▼

asked Apr 13 '17 at 12:41 PM in Blueprint Scripting

avatar image

Theblacktiger
93 8 12 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

From https://www.unrealengine.com/blog/input-action-and-axis-mappings-in-ue4

"In both C++ and Blueprints, Axis events will fire every frame passing the current value of the Axis while Action events will have the Pressed and Released outputs fire as the key(s) are pressed."

So I don't know why and how to switch it off, but it is intended. If you want an event to be fired when the axis value changes, simply save the axis value each frame and compare it to the value in the next frame. If it differs, you can fire a custom event.

more ▼

answered Apr 13 '17 at 01:38 PM

avatar image

Benergy
831 21 4 29

avatar image Theblacktiger Apr 14 '17 at 02:01 AM

Thanks for the feedback. But if it's intended, then my question should be : Why don't they fire continuously when set up in my character ?!

avatar image Benergy Apr 14 '17 at 02:56 PM

When you setup the "standard" character with your axis connected to "Add Movement Input" nodes, their events are still fired every frame. But after each frame the internal control vector, to which the input vectors are added, is resetted to (0,0,0). So each frame you have to add the same input vector if you want to keep the movement, which is done automatically by the events.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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