-
Notifications
You must be signed in to change notification settings - Fork 1
Action Triggers
There are various ways to control what camera action nodes are active in your scene (including just writing your own code and calling the start()
and end()
methods on the action nodes yourself!) but the plugin includes lots of different controllers and triggers as well, each serving a different purpose.
Inherits Area2D
This node functions almost identically to the standard Area2D node built-in to Godot, except it handles camera actions instead. You'll need to attach two nodes as children to a CameraArea2D, a CollisionShape2D/CollisionPolygon2D and a CameraAction. You can use any type of camera action with one of these areas.
There are two additional parameters you can modify in this node, filter
and allow_any
. The filter is the specific node you're looking for collisions with. If you want to allow any node to collide with the area that has the correct collision layer, check the "Allow Any" box to permit this behavior.
When a body that matches the filter (or any body if allow_any
is enabled) enters the area, the CameraAction will be enabled automatically! When that body leaves the area, the action will be stopped. Standard priority rules apply, more info here
Inherits Node2D
The Camera Action Switch serves the purpose of simplifying switching from one action to another. The switch only allows one of its attached actions to be on at a time, allowing simple toggling by index and name. By default, you can manually create a list of camera actions to include in the switch. You can also select it to be all CameraAction children of the node instead. This list can be modified at runtime if using the manual list instead of the children list, though there aren't too many cases you'd want to modify it at runtime anyways.
To use this node you'll need three important methods:
start_by_index(index: int)
: Start a specific action in the switch by its index in the list
start_by_node_name(name: String)
: Start an action in the list by the name of the node, this is not case-sensitive
end_active()
: Disable the switch and the currently active camera action inside it
Inherits CameraActionSwitch
Transition between different camera actions in a specific order, useful for animations and cutscenes. Uses the same CameraAction list system as CameraActionSwitch.
There are four different looping modes for how the sequence should behave when reaching the end, detailed below:
- End: the current action and become inactive until started again
- Repeat: Go back to the first action in the list and continue
- Ping-pong Once: Go through the list forward and backward, ending after one full cycle
- Ping-pong: Go through the list, bouncing back and fourth through the list
You can also set if this sequence should automatically start and if it should automatically progress through the sequence at a specific interval. (If interval is 0 it won't automatically progress, this is the default behavior)
To use this node in code you'll need a couple important methods:
sequence_start()
: Go to the first item in the sequence list and start it
sequence_step(step: int = 1)
: Progress through the sequence by step (step defaults to 1, only change this if you wanna skip elements in your sequence)
sequence_set(index: int)
: Skip to a specific index in the sequence and enable it
sequence_end()
: End and reset the sequence, disabling the current camera action in the sequence if there is one
sequence_pause()
: Stop the sequence but hold on to current index position, can be restarted using sequence_resume()
sequence_resume()
: Start the sequence from the last position it was in, meant to be used with sequence_pause()