Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity agent look at

private void FaceTarget(Vector3 destination)
{
    Vector3 lookPos = destination - transform.position;
    lookPos.y = 0;
    Quaternion rotation = Quaternion.LookRotation(lookPos);
    transform.rotation = Quaternion.Slerp(transform.rotation, rotation, [fill in desired rotation speed]);  
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity rigidbody2d disable 
Csharp :: c# inheritance 
Csharp :: expansion tile 
Csharp :: c# iterate sorteddictionary 
Csharp :: string c# 
Csharp :: List C# add from List 
Csharp :: unity singleton 
Csharp :: how to fix on Input.GetMouseButtonDown(0) conting as ui 
Csharp :: c# if isset 
Csharp :: search of specified registry key 
Csharp :: c# destroy function...unity 
Csharp :: How can I display image from database in asp.net mvc. I created image table and image path as varchar 
Csharp :: c# fileupload example 
Csharp :: combobox in datagrid wpf 
Csharp :: c# get smallest of 3 numbers 
Csharp :: check if two timespans intersect c# 
Csharp :: iterate through photon player gameobjects 
Csharp :: kendo validator tries to validate hidden fields 
Csharp :: How do I allow edit only a particular column in datagridview in windows application 
Csharp :: c# listview filter contains 
Csharp :: How to create a Blazor server-side application in command prompt 
Csharp :: c# calculate checksum of file 
Csharp :: unity color alpha not working 
Csharp :: c# progress bar timer 
Csharp :: C# http post request with file 
Csharp :: Unity upload image to project 
Csharp :: uwp roaming data sample 
Csharp :: write last line txt file c# 
Csharp :: add header in action asp.net mvc 
Csharp :: array sum c# 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =