Arkadaşlar kamera açısını şu şekilde yapmak için kodları nasıl düzeltmem gerek, yardım eder misiniz lütfen?
Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.ThirdPerson;
public class ThirdPersonInput : MonoBehaviour
{
public FixedJoystick LeftJoystick;
public FixedJoystick RightJoystick;
public FixedButton Button;
protected ThirdPersonUserControl Control;
protected float CameraAngel;
protected float CameraAngelSpeed = 4f;
// Start is called before the first frame update
void Start()
{
Control = GetComponent<ThirdPersonUserControl>();
}
// Update is called once per frame
void Update()
{
Control.m_Jump = Button.Pressed;
Control.Hinput = LeftJoystick.input.x;
Control.Vinput = LeftJoystick.input.y;
CameraAngel += RightJoystick.input.x * CameraAngelSpeed;
Camera.main.transform.position = transform.position + Quaternion.AngleAxis(CameraAngel,Vector3.up)* new Vector3(0,3,4);
Camera.main.transform.rotation = Quaternion.LookRotation(transform.position + Vector3.up * 2f-Camera.main.transform.position, Vector3.up);
}
}
Son düzenleyen: Moderatör: