Class Rigidbody
Assembly: UnityEngine.dll
Syntax
[RequireComponent(typeof(Transform))]
public class Rigidbody : Component
Properties
angularDrag
Declaration
public float angularDrag { get; set; }
Property Value
angularVelocity
Declaration
public Vector3 angularVelocity { get; set; }
Property Value
centerOfMass
Declaration
public Vector3 centerOfMass { get; set; }
Property Value
collisionDetectionMode
Declaration
public CollisionDetectionMode collisionDetectionMode { get; set; }
Property Value
constraints
Declaration
public RigidbodyConstraints constraints { get; set; }
Property Value
detectCollisions
Declaration
public bool detectCollisions { get; set; }
Property Value
drag
Declaration
public float drag { get; set; }
Property Value
freezeRotation
Declaration
public bool freezeRotation { get; set; }
Property Value
inertiaTensor
Declaration
public Vector3 inertiaTensor { get; set; }
Property Value
inertiaTensorRotation
Declaration
public Quaternion inertiaTensorRotation { get; set; }
Property Value
interpolation
Declaration
public RigidbodyInterpolation interpolation { get; set; }
Property Value
isKinematic
Declaration
public bool isKinematic { get; set; }
Property Value
mass
Declaration
public float mass { get; set; }
Property Value
maxAngularVelocity
Declaration
public float maxAngularVelocity { get; set; }
Property Value
maxDepenetrationVelocity
Declaration
public float maxDepenetrationVelocity { get; set; }
Property Value
position
Declaration
public Vector3 position { get; set; }
Property Value
rotation
Declaration
public Quaternion rotation { get; set; }
Property Value
sleepAngularVelocity
Declaration
[Obsolete("The sleepAngularVelocity is no longer supported. Set Use sleepThreshold to specify energy.")]
public float sleepAngularVelocity { get; set; }
Property Value
sleepThreshold
Declaration
public float sleepThreshold { get; set; }
Property Value
sleepVelocity
Declaration
[Obsolete("The sleepVelocity is no longer supported. Use sleepThreshold. Note that sleepThreshold is energy but not velocity.")]
public float sleepVelocity { get; set; }
Property Value
|
Improve this Doc
View Source
solverIterationCount
Declaration
[Obsolete("Please use Rigidbody.solverIterations instead. (UnityUpgradable) -> solverIterations")]
public int solverIterationCount { get; set; }
Property Value
solverIterations
Declaration
public int solverIterations { get; set; }
Property Value
|
Improve this Doc
View Source
solverVelocityIterationCount
Declaration
[Obsolete("Please use Rigidbody.solverVelocityIterations instead. (UnityUpgradable) -> solverVelocityIterations")]
public int solverVelocityIterationCount { get; set; }
Property Value
solverVelocityIterations
Declaration
public int solverVelocityIterations { get; set; }
Property Value
|
Improve this Doc
View Source
useConeFriction
Declaration
[Obsolete("Cone friction is no longer supported.")]
public bool useConeFriction { get; set; }
Property Value
useGravity
Declaration
public bool useGravity { get; set; }
Property Value
velocity
Declaration
public Vector3 velocity { get; set; }
Property Value
worldCenterOfMass
Declaration
public Vector3 worldCenterOfMass { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddExplosionForce(Single, Vector3, Single)
Declaration
[ExcludeFromDocs]
public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius)
Parameters
|
Improve this Doc
View Source
AddExplosionForce(Single, Vector3, Single, Single)
Declaration
[ExcludeFromDocs]
public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius, float upwardsModifier)
Parameters
AddExplosionForce(Single, Vector3, Single, Single, ForceMode)
Declaration
public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius, [DefaultValue("0.0f")] float upwardsModifier, [DefaultValue("ForceMode.Force)")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddForce(Single, Single, Single)
Declaration
[ExcludeFromDocs]
public void AddForce(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
AddForce(Single, Single, Single, ForceMode)
Declaration
public void AddForce(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddForce(Vector3)
Declaration
[ExcludeFromDocs]
public void AddForce(Vector3 force)
Parameters
Type |
Name |
Description |
Vector3 |
force |
|
AddForce(Vector3, ForceMode)
Declaration
public void AddForce(Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddForceAtPosition(Vector3, Vector3)
Declaration
[ExcludeFromDocs]
public void AddForceAtPosition(Vector3 force, Vector3 position)
Parameters
AddForceAtPosition(Vector3, Vector3, ForceMode)
Declaration
public void AddForceAtPosition(Vector3 force, Vector3 position, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddRelativeForce(Single, Single, Single)
Declaration
[ExcludeFromDocs]
public void AddRelativeForce(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
AddRelativeForce(Single, Single, Single, ForceMode)
Declaration
public void AddRelativeForce(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddRelativeForce(Vector3)
Declaration
[ExcludeFromDocs]
public void AddRelativeForce(Vector3 force)
Parameters
Type |
Name |
Description |
Vector3 |
force |
|
AddRelativeForce(Vector3, ForceMode)
Declaration
public void AddRelativeForce(Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddRelativeTorque(Single, Single, Single)
Declaration
[ExcludeFromDocs]
public void AddRelativeTorque(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
AddRelativeTorque(Single, Single, Single, ForceMode)
Declaration
public void AddRelativeTorque(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddRelativeTorque(Vector3)
Declaration
[ExcludeFromDocs]
public void AddRelativeTorque(Vector3 torque)
Parameters
Type |
Name |
Description |
Vector3 |
torque |
|
AddRelativeTorque(Vector3, ForceMode)
Declaration
public void AddRelativeTorque(Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddTorque(Single, Single, Single)
Declaration
[ExcludeFromDocs]
public void AddTorque(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
AddTorque(Single, Single, Single, ForceMode)
Declaration
public void AddTorque(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
AddTorque(Vector3)
Declaration
[ExcludeFromDocs]
public void AddTorque(Vector3 torque)
Parameters
Type |
Name |
Description |
Vector3 |
torque |
|
AddTorque(Vector3, ForceMode)
Declaration
public void AddTorque(Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode)
Parameters
|
Improve this Doc
View Source
ClosestPointOnBounds(Vector3)
Declaration
public Vector3 ClosestPointOnBounds(Vector3 position)
Parameters
Type |
Name |
Description |
Vector3 |
position |
|
Returns
GetPointVelocity(Vector3)
Declaration
public Vector3 GetPointVelocity(Vector3 worldPoint)
Parameters
Type |
Name |
Description |
Vector3 |
worldPoint |
|
Returns
GetRelativePointVelocity(Vector3)
Declaration
public Vector3 GetRelativePointVelocity(Vector3 relativePoint)
Parameters
Type |
Name |
Description |
Vector3 |
relativePoint |
|
Returns
IsSleeping()
Declaration
Returns
MovePosition(Vector3)
Declaration
public void MovePosition(Vector3 position)
Parameters
Type |
Name |
Description |
Vector3 |
position |
|
MoveRotation(Quaternion)
Declaration
public void MoveRotation(Quaternion rot)
Parameters
ResetCenterOfMass()
Declaration
public void ResetCenterOfMass()
ResetInertiaTensor()
Declaration
public void ResetInertiaTensor()
SetDensity(Single)
Declaration
public void SetDensity(float density)
Parameters
Type |
Name |
Description |
Single |
density |
|
|
Improve this Doc
View Source
SetMaxAngularVelocity(Single)
Declaration
[Obsolete("Use Rigidbody.maxAngularVelocity instead.")]
public void SetMaxAngularVelocity(float a)
Parameters
Type |
Name |
Description |
Single |
a |
|
Sleep()
Declaration
|
Improve this Doc
View Source
SweepTest(Vector3, out RaycastHit)
Declaration
[ExcludeFromDocs]
public bool SweepTest(Vector3 direction, out RaycastHit hitInfo)
Parameters
Returns
|
Improve this Doc
View Source
SweepTest(Vector3, out RaycastHit, Single)
Declaration
[ExcludeFromDocs]
public bool SweepTest(Vector3 direction, out RaycastHit hitInfo, float maxDistance)
Parameters
Returns
|
Improve this Doc
View Source
SweepTest(Vector3, out RaycastHit, Single, QueryTriggerInteraction)
Declaration
public bool SweepTest(Vector3 direction, out RaycastHit hitInfo, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
Parameters
Returns
|
Improve this Doc
View Source
SweepTestAll(Vector3)
Declaration
[ExcludeFromDocs]
public RaycastHit[] SweepTestAll(Vector3 direction)
Parameters
Type |
Name |
Description |
Vector3 |
direction |
|
Returns
|
Improve this Doc
View Source
SweepTestAll(Vector3, Single)
Declaration
[ExcludeFromDocs]
public RaycastHit[] SweepTestAll(Vector3 direction, float maxDistance)
Parameters
Returns
|
Improve this Doc
View Source
SweepTestAll(Vector3, Single, QueryTriggerInteraction)
Declaration
public RaycastHit[] SweepTestAll(Vector3 direction, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
Parameters
Returns
WakeUp()
Declaration
Extension Methods