Quantcast
Channel: Questions in topic: "unity3.4"
Viewing all articles
Browse latest Browse all 49

Player turn with move issue in unity3d

$
0
0
I have a first person controller .I want to move this man left and right ,when i press the left arrow and right arrow. For this i attach a script calle playermove. its working fine but isuue is that when i turn the playe it translate/move little bit. why ?Please help? using UnityEngine; using System.Collections; public class PlayerMove : MonoBehaviour { public float moveSpeed=5f; public Transform camera; public float posY; public float turnSpeed=50f; void Update(){ if(Input.GetKey(KeyCode.LeftArrow)) transform.Rotate (Vector3.up,-turnSpeed*Time.deltaTime); if(Input.GetKey(KeyCode.RightArrow)) transform.Rotate (Vector3.up,turnSpeed*Time.deltaTime); } }

Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>