Added things

This commit is contained in:
2022-05-13 13:29:38 +07:00
parent 85518c4f3f
commit abf262095f
589 changed files with 851744 additions and 0 deletions

View File

@ -0,0 +1,29 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AutoAim : MonoBehaviour
{
// Start is called before the first frame update
public GameObject enemy;
public float lookSpeed = 200f;
public GameObject player;
public Camera camera;
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector3 direction = enemy.transform.position - camera.transform.position;
Quaternion targetRotation = Quaternion.LookRotation(direction);
Quaternion lookAt = Quaternion.RotateTowards(camera.transform.rotation, targetRotation, Time.deltaTime * lookSpeed);
camera.transform.rotation = lookAt;
}
}