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!
asked May 22 '14 at 05:12 PM in Blueprint Scripting
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!
answered May 25 '14 at 01:52 PM
Steve Allison STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here