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"

using a gamepad how do i test for a specific range in x/y axis

I'm making a sidescroller with a 2d character. The character can aim his weapon in 8 directions. So far i can aim left, right, up, and down. I need to create a test that checks whether I'm currently pressing diagonally up or diagonally down on the left analog stick and then returns a bool. The bool will then be used to adjust the animation state. There needs to be an equal range of motion between all 8 possible axis states so that the character animates smoothly. Currently I can detect the various diagonal quadrants but the animations interfere with each other. For example if i set the diagonal SouthEast quadrant the character will fire the diagonal down animation instead of the running right animation and it also replaces the look down animation. alt text I need to know how to reduce the viable range this will equal true by about 30 %. Also I don't really know anything about vector math so if I'm doing something wrong or there is an easier way please let me know.

Product Version: Not Selected
Tags:
diagonaltest.png (315.9 kB)
more ▼

asked Apr 11 '15 at 02:29 AM in Blueprint Scripting

avatar image

MTH0211
1 2

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

1 answer: sort voted first

Ok, so I was trying to make this way more complicated than it needed to be. Here is the solution. It is actually very similar to the first solution I tried but I guess I didn't plug in the right numbers. Anyways, it still needs tweaked abit but it works as a diagonal test.alt text

more ▼

answered Apr 12 '15 at 12:02 AM

avatar image

MTH0211
1 2

(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