Heyy guys I am fairly new in touch mechanics of unity2d and trying to figure out how to touch select the player sprite and then drag it. I am trying to make a 2 player game which has 2 players in the same screen and want to drag and move them by touching on the player instead of screen. While there are some videos and tutorials on Drag in touch but i cant find how to first select the player and then drag.
We will need to understand more specifically how what I suspect is the player selection, and/or controls work. based off the information you have given, I can only make 2 speculations, and the problems they have even before trying to solve the problem you have asked about.
Are you intending for players to select a character, and then have drags and taps after that affect the selected character? If this is the case, the problem is the device will not be able to distinguish which swipes and taps go to which character. I can imagine this being circumvented by dividing the screen in 2, and having swipes and taps on either side correspond to player 1 and 2, though it still isn’t ideal since players can interfere with each other even accidentally, by swiping or tapping too far left/right or their allotted space of the screen. Having a dead section in the middle to prevent the previous issue can lead to unintended irresponsiveness for the same reasons as before.
Are you intending for players to swipe and tap the player character itself? If this is the case, It may depend on the game. While I am unsure of the type of game you are making, the fact you mention movement as a feature means there are characters that will change position on the screen. The problem here is the playability of the game. It is unlikely the character sprites in such a game are large, so hitting a small moving target is going to be frustrating. Compound this problem with player’s hands blocking the screen when they try to do swipes or taps, and it will just be an overall bad experience.
Yaaa I understood that this type of implementation would be bad so i am thinking of making it a multiplayer server game with photon pun, Thank you for your input ![]()