SPhysicsHit
ClientTypes
Members 7
| Property | Object | – |
| Property | Position | Where the physics hit occurred |
| Property | Normal | The normal of the hit |
| Property | UV | The UV coordinates of where the hit occurred on a mesh. |
| Property | UV2 | The UV2 coordinates of where the hit occurred on a mesh. |
| Property | Distance | How far down a ray or from the collider, the hit occurred |
| Property | ContainsHit | Whether it was a hit or not |
Properties
ObjectRead only
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitGameObject = hit.Object
Lua
example 2
PositionRead only
Where the physics hit occurred
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitPosition = hit.Position
NormalRead only
The normal of the hit
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitNormal = hit.Normal
UVRead only
SVector UV {get; }
The UV coordinates of where the hit occurred on a mesh.
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV = hit.UV
UV2Read only
SVector UV2 {get; }
The UV2 coordinates of where the hit occurred on a mesh.
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV2 = hit.UV2
DistanceRead only
float Distance {get; }
How far down a ray or from the collider, the hit occurred
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitDistance = hit.Distance
ContainsHitRead only
bool ContainsHit {get; }
Whether it was a hit or not
Example
Lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitContainsHit = hit.ContainsHit



