SPhysicsHit
العميلالأنواع
الأعضاء 7
| خاصية | Object | – |
| خاصية | Position | Where the physics hit occurred |
| خاصية | Normal | The normal of the hit |
| خاصية | UV | The UV coordinates of where the hit occurred on a mesh. |
| خاصية | UV2 | The UV2 coordinates of where the hit occurred on a mesh. |
| خاصية | Distance | How far down a ray or from the collider, the hit occurred |
| خاصية | ContainsHit | Whether it was a hit or not |
الخصائص
Objectللقراءة فقط
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitGameObject = hit.Object
Lua
example 2
Positionللقراءة فقط
Where the physics hit occurred
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitPosition = hit.Position
Normalللقراءة فقط
The normal of the hit
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitNormal = hit.Normal
UVللقراءة فقط
SVector UV {get; }
The UV coordinates of where the hit occurred on a mesh.
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV = hit.UV
UV2للقراءة فقط
SVector UV2 {get; }
The UV2 coordinates of where the hit occurred on a mesh.
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV2 = hit.UV2
Distanceللقراءة فقط
float Distance {get; }
How far down a ray or from the collider, the hit occurred
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitDistance = hit.Distance
ContainsHitللقراءة فقط
bool ContainsHit {get; }
Whether it was a hit or not
مثال
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitContainsHit = hit.ContainsHit



