Unity 3d Rotate player with finger like free fire/Pubg

Unity 3d Rotate player with finger like free fire/Pubg .Hey,Guys welcome back to unity tips pro site.In this post we discus about How to Rotate player with finger like free fire/Pubg .This is very Easy and fast trick.I teach you step by step How to Rotate player with finger like free fire/Pubg. So let get started...
unity rotate objects with finger

Follow These Steps to Rotate Player 

this is very easy method to rotate our player in main menu like free fire or pubg game. implement this work to follow some steps...

  1. First we need 3d model that we rotate
  2. Set camera position near the model.like this image
unity 3d rotate 3d model with swipe

     3.Have no need any other components.
     4.Add this script to 3d model.

/////////////////////////////////////////////////////////............/////////////////////////////////////////////////////////////

using UnityEngine;


public class Rotate : MonoBehaviour {

 private Touch touch;
 private Vector2 touchPosition;
 private Quaternion rotationY;
 private float rotateSpeedModifier = 0.1f;
 // Update is called once per frame
 void Update()
 {
 if (Input.touchCount > 0)
 {
 touch = Input.GetTouch(0);
  Debug.Log("Rotate");
 if (touch.phase == TouchPhase.Moved)
{
 rotationY = Quaternion.Euler (
 0f,
 - touch.deltaPosition.x * rotateSpeedModifier,
 0f);
 transform.rotation = rotationY * transform.rotation;


 }
 }
 }
}

/////////////////////////////////////////////////////////............/////////////////////////////////////////////////////////////
5.This script test only your Phone,like this
6.I hope you enjoy this post and something learn.
unity how to rotate model with finger


0 Comments