merge projects and arrange script folders
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public class CharacterMovement : MonoBehaviour
|
||||
{
|
||||
public NavMeshAgent playerNavMeshAgent;
|
||||
|
||||
public Camera playerCamera;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if(Input.GetMouseButton(0))
|
||||
{
|
||||
Ray myRay=playerCamera.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
|
||||
if(Physics.Raycast(myRay, out hit))
|
||||
{
|
||||
playerNavMeshAgent.SetDestination(hit.point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user