当前位置:网站首页>Value on the object Z rotation synchronization panel in unity
Value on the object Z rotation synchronization panel in unity
2022-07-24 09:52:00 【Cangxing】
unity Medium object z Rotate the value on the synchronization panel
// Get the current angle
Vector3 angle = transform.eulerAngles;
// rotate
angle.z += rbody.velocity.y;
// take z Rotate the value on the synchronization panel
angle.z = angle.z - 180;
if (angle.z > 0)
{
angle.z -= 180;
}
else
{
angle.z += 180;
}
Restricted object z The angle of rotation
angle.z = Mathf.Clamp(angle.z,-MaxAngle,MaxAngle);
notes :
function
public static float Clamp (float value, float min, float max);
Parameters
| Parameters | notes |
|---|---|
| value | Floating point value , Limit to the range defined by the minimum and maximum values . |
| min | The smallest floating-point value to compare . |
| max | The maximum floating-point value to compare . |
return
| Parameters | notes |
|---|---|
| float | Floating point value result between minimum and maximum . |
describe
Clamp the given value between the given minimum floating point value and the given maximum floating point value . If within the minimum and maximum range , Returns the given value .
If the given floating-point value is less than the minimum value , Returns the minimum value . If the given value is greater than the maximum , Then return the maximum value . Use Clamp A value can be limited to a range defined by the minimum and maximum values .
边栏推荐
- Spark Learning: using RDD API to implement inverted index
- Anti shake and throttling
- Where is the bitbucket clone address
- C # +opencvsharp+wpf learning notes (I)
- OPENCV学习DAY5
- Simple parsing JSON strings with regular expressions
- Getting started with web security - open source firewall pfsense installation configuration
- Cess test online line! The first decentralized storage network to provide multiple application scenarios
- PHP Basics - session control - Session
- Linux deployment mysql8.0
猜你喜欢

error: field ‘XXX’ declared as a function

力扣300-最长递增子序列——动态规划

Spark Learning: implement compact table command
![[don't bother with reinforcement learning] video notes (I) 1. What is reinforcement learning?](/img/84/48a6a83192a12dafd88bcd74db0955.gif)
[don't bother with reinforcement learning] video notes (I) 1. What is reinforcement learning?
![[STM32 learning] (6) use of serial port 1 (usart1)](/img/b1/430d3501a99e46958c066f7fd7eee9.png)
[STM32 learning] (6) use of serial port 1 (usart1)

Build practical product help documents to improve user satisfaction

07 Jason module
![[don't bother with intensive learning] video notes (III) 1. What is SARS?](/img/5c/4636db2849ba8514976a5afaf56e38.png)
[don't bother with intensive learning] video notes (III) 1. What is SARS?

What is the cloud native mid platform business architecture?

Spark Learning: compile spark source code in win10
随机推荐
Reading makes people improve my list
Add SSH key to bitbucket
MySQL基础篇(一)-- SQL基础
Development history of the first commercial humanoid biped robot in China
Spark Learning: Spark implementation of distcp
Cess test online line! The first decentralized storage network to provide multiple application scenarios
Raspberry Pie: the serial port has been unable to read the information sent by the upper computer
note: expected ‘void * (***)(void ***)’ but argument is of type ‘void (*)(void *)’
[Luogu p3426] SZA template (string) (KMP)
[STM32 learning] (4) press the key to control the flow light
String sort
It is reported that the prices of some Intel FPGA chip products have increased by up to 20%
How to solve command 'xxx GCC' not found, but can be installed with:??
Android Version Description security privacy 13
2022 trusted cloud authoritative assessment released: Tianyi cloud has obtained ten certifications and five best practices
The heads of the five major international institutions called for urgent action to deal with the global food security crisis
Yarn: unable to load file
Anti shake and throttling
[STM32 learning] (10) stm32f1 general timer realizes pulse counter
[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?