Hey Guys I want my gun clone atached as a child of my Player, so when i rotate my view the gun is moves the same directions. Can someone help me pls.
public class FirstPersonController : MonoBehaviour
{
public Transform cameraTransform;
public CharacterController characterController;
public GameObject normalGun;
public GameObject deagle;
public float cameraSensitivity;
public float moveSpeed;
public float moveInputDeadZone;
int leftFingerId, rightFingerId;
float halfScreenWidth;
Vector2 lookInput;
float cameraPitch;
Vector2 moveTouchStartPosition;
Vector2 moveInput;
void Start()
{
leftFingerId = -1;
rightFingerId = -1;
halfScreenWidth = Screen.width / 2;
moveInputDeadZone = Mathf.Pow(Screen.height / moveInputDeadZone, 2);
Instantiate(normalGun, normalGun.transform.position, Quaternion.identity);
}