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"

'Angry Birds' shooting mechanic (Input and Screen size)

I want to make exactly the same shooting system as Angry Birds. I have a few problems with creating this system.

  1. Input: It is for Android / ios but I also test the game on my pc, which inputs do I need in (Project Settings - Input - Action Mapping)? I thought Touch1 and Left Mouse Button?

  2. how do I program it so that it works the same on different screen size. (InputAction - key - get input vector key state)? Perhaps something like (ConvertScreenLocationToWorldSpace)?

I've tried it with all these examples and play around with different settings but I can't get it working...

I would be very happy if someone can help me with a clear explanation or sends 2 pictures. One of the Input in (Project Settings - Input - Action Mapping) and one of the blueprint.

How I'm going to program it: On press - Save the vector of the press location. On release - VectorPress-VectorRelease=VectorForceOfShooting. Then I put VectorForceOfShooting In a formule and the outcome in (Add Impulse - Target is a Pawn). If there is a better way, let me know.

Product Version: UE 4.20
more ▼

asked Sep 27 '18 at 02:19 PM in Blueprint Scripting

avatar image

146 4 7 12

avatar image mightyenigma Sep 27 '18 at 06:42 PM

I don't know the answers to all your questions but I had an idea for an alternate approach where you deproject the touch/mouse drag into the World rather than the screen, and have it trace hit the actors in the world rather than in the UI screenspace. That way it doesn't matter what the screen size or coordinates are.

avatar image Colder347 Sep 28 '18 at 02:57 PM

Mightyenigma, Thanks for your idea. Unfortunately the only difference is that my pawn is not being pulled. While dragging, the pawn is standing still and if you let go, the pawn will be launched.

avatar image mightyenigma Sep 28 '18 at 03:47 PM

That's okay - my idea will probably still work if you pull a separate component or actor and then use its pulled offset to determine the pawn's launch velocity.

You can also get it to work using the conversion between Touch coordinates, Screen coordinates, and World coordinates, which I think are all different. I think it's about the same amount of work either way, just different ways.

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

0 answers: sort voted first
Be the first one to answer this question
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