Hey.
I have swipe controlls and i don't know why it thinking that i keeps swiping down.
Lets start from the begining.
So i have script that gathers the swipe direction.
And the swipe direction is converted to a move by this code.
Convert direction code:
up_true = 1 because of the next script
direction = 1000 is because i want to stop after one step
Then i got this code to make moves
Both codes are in step event.
The thing is this is working, when i swipe up my character walks up, i have same codes also for right and left and it is working well (only when code for converting swipe down is deleted)
When i paste the convert direction code for moving down, this code:
My character is walking backward non stop, when i delete this code this isnt happens. That's wierd because this code is same for up, right and left.
The best part is i also have an button press event for each dir and in these events i have codes like:
And when the converting code for down (only for down) movement isnt pasted the controlls works well (i mean the swiping (up, right, left) and the keyboard buttons (in each direction, even for down)
Why the hell this isnt working?
I have swipe controlls and i don't know why it thinking that i keeps swiping down.
Lets start from the begining.
So i have script that gathers the swipe direction.
And the swipe direction is converted to a move by this code.
Convert direction code:
Code:
//Up
if ((direction > 45) && (direction <=135))
{
up_true = 1;
direction = 1000
}
direction = 1000 is because i want to stop after one step
Then i got this code to make moves
Code:
///go up
if (up_true = 1){
up_true = 0
<the movement code here>
}
The thing is this is working, when i swipe up my character walks up, i have same codes also for right and left and it is working well (only when code for converting swipe down is deleted)
When i paste the convert direction code for moving down, this code:
Code:
if ((direction > 225) && (direction <315))
{
direction = 1000
down_true = 1;
}
The best part is i also have an button press event for each dir and in these events i have codes like:
Code:
down_true = 1
Why the hell this isnt working?
Last edited: