Skip to content

Added spring arm node

QbieShay requested to merge github/fork/QbieShay/master into master

Thanks to @AndreaCatania, Godot now can have a Spring Arm node! Closes #16508 (closed).

The spring arm node is a node that pushes all its children back on his local z considering collision with the environment. If there is a collision, the spring arm will reduce its length. The spring arm only moves its immediate children, and only the location( rotation control it's left in the hands of the developer ). It supports collision masks and specific body exclusion. It has a shape as property which is the shape that will be cast to do collision avoidance. Multiple shapes are not supported.

This type of node comes in handy when making 3rd person cameras, but it's not bound to that.

Example usage:

A classic responsive 3rd person camera can be achieved by simply adding the spring node as a child of the character, regulating its orientation to match the desired angle, and adding a camera as a child of the spring arm node. This implementation can be modified in various ways, for example, moving the spring arm on the shoulder of the character will achieve a shoulder camera with minimal effort.

The spring arm itself does not move on his own, so it is possible to control its motion , for example, for a racing game it's useful to have damping on the camera movement, and this can be easily achieved by scripting the spring arm node.

Merge request reports