Breakroom is now Sinewave Campus. Book a meeting

SPhysicsHit

ClientTypes
Dans cette classeObject
  1. Propriétés
  2. Object
  3. Position
  4. Normal
  5. UV
  6. UV2
  7. Distance
  8. ContainsHit
Membres 7
PropriétéObject–
PropriétéPositionWhere the physics hit occurred
PropriétéNormalThe normal of the hit
PropriétéUVThe UV coordinates of where the hit occurred on a mesh.
PropriétéUV2The UV2 coordinates of where the hit occurred on a mesh.
PropriétéDistanceHow far down a ray or from the collider, the hit occurred
PropriétéContainsHitWhether it was a hit or not

Propriétés​

ObjectLecture seule​

SGameObject Object {get; }

Exemple

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

hitGameObject = hit.Object
Lua
example 2

PositionLecture seule​

SVector Position {get; }

Where the physics hit occurred

Exemple

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

hitPosition = hit.Position

NormalLecture seule​

SVector Normal {get; }

The normal of the hit

Exemple

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

hitNormal = hit.Normal

UVLecture seule​

SVector UV {get; }

The UV coordinates of where the hit occurred on a mesh.

Exemple

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

hitUV = hit.UV

UV2Lecture seule​

SVector UV2 {get; }

The UV2 coordinates of where the hit occurred on a mesh.

Exemple

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

hitUV2 = hit.UV2

DistanceLecture seule​

float Distance {get; }

How far down a ray or from the collider, the hit occurred

Exemple

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

hitDistance = hit.Distance

ContainsHitLecture seule​

bool ContainsHit {get; }

Whether it was a hit or not

Exemple

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

hitContainsHit = hit.ContainsHit