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


Introduced in

Version:2.05

Description

Description:

Defines a water current which affects any swimmers, divers, and PhysX boats in it.

The current area is defined using a Location, and its strength is weaker towards the edges (but not affected by depth). Multiple currents can be overlaid, and their effects are combined.

Syntax

Syntax:location setCurrent [direction, speed]
Parameters:
  • location: Location - Defines the current area.
  • direction: Number - Direction of current.
  • speed: Number - Speed (in m/sec) of current.
Return Value:Nothing

Examples

Examples:
_stream = createLocation ["OutLineArea", getPos player, 50, 100];
_stream setCurrent [0,5];

Effect of multiple, overlapping currents (boat drifting from left to right):

Additional Information

See also: waterImpulse
Multiplayer:Due to the fact that locations are not broadcast through the network, in order to make currents work in multiplayer, both, the location creation and the setting of the current, have to use publicExec.
Problems:

Notes