im making a third person shooter sort of a game like the last stand. im making my character now but im stuck on making my character arms hands and the gun follow when my cursor is please can anyone help?
Your question is more or less vague. When aiming a target, does the whole body or upper body or shoulder rotate? Anyway, the following C# code will rotate the gun:
using UnityEngine;
using System.Collections;
public class GunRotator : MonoBehaviour
{
public float rotSpeed = 0.01f;
public float angle = 90.0f;
void Update()
{
float dirX = Input.GetAxis ("Mouse X") * angle;
float dirY = Input.GetAxis ("Mouse Y") * angle;
transform.Rotate(dirY * Time.deltaTime * rotSpeed, dirX * Time.deltaTime * rotSpeed, 0, Space.World);
}
}