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



