Trying to make a swipe mechanic in unreal 5

25 Views Asked by At

I'm trying to create a swipe to move mechanic for a prototype mobile game, sort of like Lazy Jump, where the character jumps in the direction you swipe. I was doing good on creating the movement until I realized that the top left of the screen is the origin instead of the center. this messes up my idea a lot because I cant just subtract the end location of the swipe from the start location to get the direction of the launch desired. How can I use the center of the screen in my code to make it work?

at this point my code flings the character in weird directions that I don't want it to go. I have a program that calculates the middle X and Y of the screen but don't know how to implement it yet.

set swipe start and end checks if swipe is long enough moves the character based on the direction of the swipe calculates the size of any screen played on, this variable is not used in any other part of the code yet

0

There are 0 best solutions below