GSC reference › Built-in
ShouldFaceMotion()
Built-in (engine)
Server
AI Called on: actor
Determines if the AI should face the motion direction. Use self.faceMotion instead of this except when the AI is just beginning to move.
Signature
<actor> ShouldFaceMotion()
Called on an entity: actor ShouldFaceMotion(...)
Example (from Treyarch's docs)
self ShouldFaceMotion()
Real uses in BO3's scripts
Called 4 times in the decompiled scripts. A few, zombies first:
- scripts/shared/ai/archetype_human_locomotion.gsc, line 87
if(entity shouldfacemotion()) - scripts/shared/ai/archetype_human_locomotion.gsc, line 122
if(entity shouldfacemotion()) - scripts/shared/ai/archetype_human_locomotion.gsc, line 332
if(!behaviortreeentity shouldfacemotion()) - scripts/shared/ai/archetype_utility.gsc, line 2823
if(behaviortreeentity shouldfacemotion())
Related built-ins
- SetSlowMotion()Sets the current slow motion timescale interpolation.
- GetNavMeshFaceNormal()Returns the face normal vector of the closest navmesh point to the passed in position, within the search radius.
- GetWheelSurface()Returns the surface type of the given wheel as a string.
- GetFXFromSurfaceTable()Returns the fx for a given surface type from the surfacefxtable.
- SendFaceEvent()Broadcast to the client a face event
- GetSurfaceStrings()Returns an array containing all the surface names
- MarkNoVehicleNavMeshFaces()Update the novehicle flag on navmesh faces.
- GetInfluenceFacePos()Returns the faces pos on the influence map
- GetInfluenceNumFaces()Returns the number faces on the influence
- GetSoundFromSurfaceTable()Returns the fx for a given surface type from the surfacefxtable.
- IsPlayerSwimmingOnSurface()Return if a player is swimming
- MotionPulse_Enable()Enable or disable the sitrep scan
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).