Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to rotate object in unity only on one axis

// If you want the obj to rotate on only one axis do this

// Create vector3
Vector3 target_position = new Vector3(transform.position.x,
                                                target.position.y,
                                                transform.position.z);
// give the target_position to transform.LookAt

transform.LookAt(target_position);
Comment

unity rotate around axis

transform.Rotate(axis, degrees);
Comment

PREVIOUS NEXT
Code Example
Csharp :: .net core check if linux 
Csharp :: event trigger by code unity 
Csharp :: how to set a transform equal to something unity 
Csharp :: C# program that joins List of strings 
Csharp :: recursive reverse linked list 
Csharp :: wpf arrow button 
Csharp :: how to create a list c# 
Csharp :: Unity Interstitial ad C# 
Csharp :: c# and in if statement 
Csharp :: read file using c# 
Csharp :: C# loop through array of objet 
Csharp :: how to set picturebox width with form width in c# 
Csharp :: lcm of list of number 
Csharp :: asp.net model 
Csharp :: split string c# 
Csharp :: unity switch 
Csharp :: update listbox using class c# 
Csharp :: unity class 
Csharp :: get sha1 hashcode from c# 
Csharp :: c# get property type of list 
Csharp :: c# get function name 
Csharp :: c# how to set string list 
Csharp :: c# string to int 
Csharp :: entity framework insert 
Csharp :: c# loop through dictionary 
Csharp :: if viewbag is null 
Csharp :: what value of combobox index c# 
Csharp :: how to set border for groupbox in c# 
Csharp :: json serialization 
Csharp :: c# make file writable 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =