I'm using drag/drop to control a character in a game I'm making, but unfortunately it allows for solid objects to be dragged through each other, and I can't have my Player going through walls.
One solution I've read about is using "Move To" to re-create drag-drop behaviors, which should allow collisions to happen between solid objects.
It seems like it should be simple to pull off, but I can't quite wrap my head around it.
The way I'd like it to work is to have the object move relative to wherever I touch and drag (so you don't actually have to touch the player object, and I also don't want it to zoom over to where I'm touching).
The best I can do on my own is this:
+ System: Every tick
+ Touch: Is in touch
-> Player: Move to (Touch.X-Player.X, Touch.Y-Player.Y) (Direct)
As you can see there are a few problems. Namely:
- The object moves just from tapping and holding, even without any dragging
- When you do drag on the screen, the object moves kind of slowly and is not as "snappy" and responsive as the real Drag-Drop behavior
- Also, after dragging, tapping anywhere just sends the object scrolling off the screen forever