Move 2D Game Object With Finger Swipe In Mobile Game Made With Unity Software | Android Or iOS
Автор: Alexander Zotov
Загружено: 2021-08-12
Просмотров: 3707
Описание:
#unityswipe #unitymove #unityandroid #unitymobile
In this video I show you a quite simple script that will help you to move your character or any game object up, down, left and right with finger swipe in a mobile game (Android or iOS). Also a simple animation is implemented.
I play games here - / zzotoff
You are very welcome :-)
Thank you :-)
Previous videos
2D Top Down Grid Based Movement - • 2D Top Down Grid Based Movement | Move Cha...
Simple Animation For Character Movement - • Simple Animation For Character Movement In...
Project Here https://drive.google.com/file/d/1ebuU...
In the previous videos which you can get by the link in the description I created this simple project. I recommend taking a look at those videos. In this project I can move my character with the arrow buttons of my keyboard. To make it possible to use this movement feature on mobile platforms I modified my script a bit. Here it is. I use a start touch and end touch positions to determine which way my character should go. Coroutine is used here as well. So in the update method instead of reading keyboard input I get touch input. Start touch position is obtained when I touch the screen. End touch position is obtained when I release my finger. And depending on coordinates and differences between those positions a corresponding direction is passed to coroutine which performs the movement and simple animation.
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: