Moving objects in 3D with swipes

Hey guys,

How would one move an object in the direction of your swipe in 3d Space?
I know how to do it in 2d space, by creating a 2D vector of the press and the release and substracting them, but how would one go about moving an object in 3D, in the direction of the swipe?

It depends a lot on what you’re trying to do, like if you’re wanting it to just travel at an angle or reach some kind of swipe destination, and also the camera perspective.

But in the most simple form, you can use your x/y vector of the screen swipe as the x/y direction of the item’s movement, like an impulse.

If that’s not enough info for you, then I can help further if you provide more details on your gameplay and how this is integrated :slight_smile:

Hey thanks for answering!

Well basically, Theres cubes all around the level (Sort of isometric view), you can rotate the camera around the central point of the level, and you choose a cube by pressing on it, and swipe in a direction (Either X,Y,Z) and he continues on that direction until he hits a collision. The problem here is that since the camera rotates around, I cant just use Horizontal and vertical swipes as a way to translate that into X and Z or Y and Z, considering the angles could be changed by the player…

If this isn’t clear enough, I could show you a quick scene, with pictures explaining what I want to be able to do in that scene?

Thanks alot for taking the time to answer!

Don’t know how I never saw your response; my apologies!

Are you still working on this issue?

If so, I’m more than happy to help you out; just give me all the relevant details so we can tackle it.