Hi,
Wondering is someone could help with a simple exercise. I have a cube , tap on it to translate up, while the cube is still in the air swipe right to make it spin right , if no swipe was received return to ground position.
Thank you.
Hi,
Wondering is someone could help with a simple exercise. I have a cube , tap on it to translate up, while the cube is still in the air swipe right to make it spin right , if no swipe was received return to ground position.
Thank you.
Hi there,
I bet easiest would be to go to Asset Store, check out free and possibly commercial touch related assets;
Then you can do swipe detection without head ache.
You can also check out Touch class from scripting manual;
You then have many possibilities.
A. Just do screen space distance / position checks using Touch to measure direction and distance of swipe.
B. You can do world space swipe by raycasts in addition to using Touch. Then you can do things relative to world distances which might be something you might want to do… or not.
Having asset store problems
usually my first stop but going to need the communities help on this one.
I guss my question is more geared to how to order the calls using co- routines or if I should even use them.
Hi again - Did you check Touch class? It isn’t complicated at all, and then only thing you would need is to set your rigidbody velocities (rotation and linear).
Ahh… OK. Then maybe just make some counter.
If swipe not received during 1sec when in air, stop listening for swipes, and transition your cube back to ground.
Otherwise, if swipe that is right direction swipe is received, trigger some rotation animation, or apply force according to swipe length / speed.