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"

Get Gamepad Thumbstick X/Y axis function in C++

Hey guys ,I've been trying to find a C++ function that matches a blueprint node:

alt text

I've tried calling a few functions in C++:

  float avalue = GetInputAxisValue("MoveRight");
  float bvalue = InputComponent->GetAxisValue("MoveRight");

The thing is that I get a value between 0 or 1 and the blueprint node actually returns the ax and how pressed is it, so if you're holding the stick halfway in the X, you'll get 0.5f instead of 1.

Thank you in advance! :)

Product Version: UE 4.20
Tags:
gpad.png (27.5 kB)
more ▼

asked Feb 21 '19 at 11:00 AM in C++ Programming

avatar image

jigo_kurti
1 1 3

avatar image HOUmmel Feb 22 '19 at 02:07 PM

"MoveRight" is Axis or Action Bound?

avatar image jigo_kurti Feb 23 '19 at 09:13 AM

It is axis bound.

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

1 answer: sort voted first

Bind some Function to "MoveRight" Axis Event

     PlayerInputComponent->BindAxis("MoveRight", this, &MyCharacter::MoveRight);

Print Value to Log:

     void MyCharacter::MoveRight(float Value)
     {
         UE_LOG(LogTemp, Warning, TEXT("%f"), Value);
     }

This prints the Values you need

more ▼

answered Feb 23 '19 at 02:53 PM

avatar image

HOUmmel
43 3 8 12

(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