Breakroom is now Sinewave Campus. Book a meeting

SPhysicsHit

客户端类型
在此类中Object
  1. 属性
  2. Object
  3. Position
  4. Normal
  5. UV
  6. UV2
  7. Distance
  8. ContainsHit
成员 7
属性Object–
属性PositionWhere the physics hit occurred
属性NormalThe normal of the hit
属性UVThe UV coordinates of where the hit occurred on a mesh.
属性UV2The UV2 coordinates of where the hit occurred on a mesh.
属性DistanceHow far down a ray or from the collider, the hit occurred
属性ContainsHitWhether it was a hit or not

属性​

Object只读​

SGameObject Object {get; }

示例

Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitGameObject = hit.Object
Lua
example 2

Position只读​

SVector Position {get; }

Where the physics hit occurred

示例

Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitPosition = hit.Position

Normal只读​

SVector Normal {get; }

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