Resources
Answers
Examples
Sign in
Get Started
What do you want to save?
Add Code snippet
New code examples
C#
2022-03-17 00:35:48
unity how to lock rotation
public float lockPos; void Update() { // Locks the rotation. transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos); }
Add solution
Other
2022-03-06 09:35:11
transform.rotation = closestTransform.rotation;
transform.rotation = closestTransform.rotation;
Add solution
C#
2022-02-27 21:00:02
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, [...
Add solution
C#
2022-02-25 06:35:01
unity default rotation
transform.rotation = Quaternion.identity;
Add solution
C#
2022-02-21 11:10:04
how to rotate object gradualy unity
var scalingFactor = 1; var rotateTo : Transform; var rotateFrom : Transform; if(grounded == false) { transform.rotation = Quaternion.Slerp(rotateFrom.rotation, rotateTo.rotation, Time.deltaTime/scalingFactor); }
Add solution
Other
2022-02-11 19:35:02
how to rotation in something in unity
public Transform t; transform.rotation = Quaternion.Eular(x,y,z);
Add solution
C#
2022-01-26 18:55:36
unity face direction of movement
transform.rotation = Quaternion.LookRotation(dir);
Add solution
C#
2021-11-22 18:57:20
unity 2d looka tt mouse
void Update() { Vector3 dir = Input.mousePosition - Camera.main.WorldToScreenPoint(transform.position); float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
Add solution
C#
2021-11-22 18:52:47
unity 2d looka tt mouse
void Update() { Vector3 dir = Input.mousePosition - Camera.main.WorldToScreenPoint(transform.position); float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
Add solution
C#
2021-11-22 18:45:56
unity 2d looka tt mouse
void Update() { Vector3 dir = Input.mousePosition - Camera.main.WorldToScreenPoint(transform.position); float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
Add solution
‹
1
2
3
4
5
6
7
8
9
10
11
›
Best helpers
daily
weekly
monthly
for 3 months
Michaeljt
+5
Nelson Menezes
+5
Andrei Petrenko
+5
Sudheesh
+5
Required
+5
Annedy
+5
Aesthetic_Bran
+5
F1234k
+5
Ann
+5
AndyP
+5
show more
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Welcome Back!
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.