Touch Input Vector Position
I'm having some trouble on setting my touch input. I'm trying to make an object move with a touch swipe, but, I'm not achieving it. As you can see by the print, the problem seems to be in my touch input.
My object appears with X and Y coordinates negative, while my input is with both of them positive. At this time, I was clicking right above the object.
Also, when I swipe up, for exemple, my object moves to the left, like his pivot is rotated. I've verified it and it's not.
It's meant to be an android game.
Can anyone help me with that? There is also a print of my code where i get my click's position.
asked May 25 '18 at 01:45 AM in Blueprint Scripting
Original mouse position uses screen coordinates, while object position uses world coordinates.
So you should get mouse / touch position, convert it from screen to world - this returns location on near clip plane. Then you must add some offset vector, to move it on desired height. Then apply result location to object.
Some time ago I have experimented with game like this. I used trace result under finger and collision box to get desired location in world, to place aircraft. But maybe you can find other way to convert screen location to desired world location on specific height (Z).
answered May 25 '18 at 05:31 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here