Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.19

Description

Description:

Rotates an object, giving it the specified pitch and bank, in degrees.

  • Pitch:
    • 0 when the object is level.
    • 90 when pointing straight up.
    • -90 when pointing straight down.
  • Bank:
    • 0 when the the object is level.
    • 90 when the object is rolled to the right.
    • -90 when rolled to the left.
    • 180 when rolled upside down.

Note: The object yaw can be set with the setDir command, which should be issued before using this function, if required. The pitch / bank can be leveled out (set to 0) by using the setDir command.

Syntax

Syntax:[object, pitch, bank, apply] call fn_vbs_setPitchBank
Parameters:
  • object: Object - Object to rotate.
  • pitch: Number - Pitch degree.
  • bank: Number - Bank degree.
  • apply: Boolean - Whether the pitch/bank should be applied to the object, or whether to just return the calculated vectors (optional, default: true) (V1.22+).
Return Value:Array - [vectorDir array Vector3D, vectorUp array Vector3D] (V1.22+, in older version, returns Nothing).

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
[player, 45, -45] call fn_vbs_setPitchBank

Additional Information

See also: fn vbs getPitchBank, setVectorDirAndUp, setMaxBank
Multiplayer: 
Problems: 

Notes






This function is similar to
setVectorDirAndUp
, however the inputs (pitch / bank) are more natural to work with. There are certain situations where working with absolute positions and vectors are more useful, and in those cases,
setVectorDirAndUp
should be used instead. But in general, you should find this function to be more useful.