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 can I update a rotation to point towards a touch input?

Hello, I am struggling to do this correctly. I have a 2d sidescroller and I want an object to rotate on one axis (normal to the mobile device screen) and point towards the touch input. Can someone help me with the logic required? I have the variables for the axis origin and i am correctly updating the variable for the location of the touch input, I just don't know the necessary scripting to tell the axis to rotate towards the touch input location around the axis origin. Is there a way to rotate something towards a vector2d because I am getting the correct vector2d from the axis origin to the touch input, I am just not sure how to correctly update the delta rotation on the component to point in the direction of the vector2d. Screenshot attached. Thanks for any help!alt text

Product Version: Not Selected
touch_rotator.jpg (53.0 kB)
more ▼

asked May 22 '14 at 05:12 PM in Blueprint Scripting

avatar image

221 25 25 201

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

1 answer: sort voted first

Hey ahopps01,

If you are already successfully getting the touch input's world space location (2D), then you can use a similar solution to what is presented here: https://answers.unrealengine.com/questions/42810/having-npc-rotate-towards-player-character.html with the Find Look at Rotation using your arrow's location and the touch location.

Hope that helps out!


more ▼

answered May 25 '14 at 01:52 PM

avatar image

Steve Allison STAFF
4.3k 123 58 209

avatar image THX2000 Mar 04 '15 at 08:22 PM

HI Steve

How we can get the touch input's world space location (2D) inside bluprint and not Level bluprint.

Regards THX2000

(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