Godot: Spring Arm Node

Created on 9 Feb 2018  路  14Comments  路  Source: godotengine/godot

Godot version: 3.0

Issue description: I am proposing a built-in Spring Arm Node.

Unreal Engine has a Spring Arm Component you can use to attach to cameras. A Spring Arm is a line between two objects that expands and contracts when either object collides with the environment. Spring Arms can also be animated manually, for instance, animating the length of a short Spring Arm between a camera and a first person player character to create a head bob.

It's extremely useful, and it seems like it'd be a great match for making Godot that much easier/more fun to use. The following image demonstrates a few of the available options for Spring Arms. For example, how much lag (and in what rotation) there should be between the player character and the camera.

Image of Unreal Engine Spring Arm Details Panel

feature proposal core

Most helpful comment

Hi, i started working on the spring node. For now it is really basic but i hope it solves some of the problems :) planning to make it a builtin node soon (TM).

https://github.com/QbieShay/GodotSpringArm

All 14 comments

I prefer you just describe what you want instead of linking to the documentation of another engine. Different engines have different workflows and it's not always straightforward to understand how their feature would apply to Godot. Also, the image is not helpful, it's just a bunch of settings which are meaningless without a description.

What vnen said. This issue left me a bit confused, and admittedly I've not been able to understand UE4's documentation too well. It'd be best if you try to explain what this idea does, even if you're pretty much rewording the documentation you linked to.

Reading up on the docs, from what I can understand, this causes the camera to have a slight (configurable) lag behind the player character (hence springy). It would also prevent the camera from going through collision. If I'm to assume this is what you're suggesting, and this is not already implemented, then I would be in support of such a feature.

The major benefit of spring arm is the camera not going through collisions.

Having an easy build-in setups is a plus.

How would you expect it to work?
Would you want it to be a built-in Node or a plugin with a scene and a script?

UE4's spring arm component is "springy" in the sense that it tries to keep the distance (of the attached thing/camera) as close to the configured maximum distance as possible, but compresses and expands according to the environment:

When you move the camera such that a wall would be between it and the thing it follows (generally the player) it compresses so the camera is between the player and that wall.

And yeah, it smoothes/lags movement a bit.

Short, few second-long demo:
https://www.youtube.com/watch?v=-hcoNgtoT8I

@vnen Edited for clarity. Also, the attached image was to show a few of the available settings, not to explain the component (that's what the link was originally for).

@CiaraBurkett @mhilbrunner would you prefer a dedicated node or a property of the camera?
My idea at the moment is to create a special physic node that behaves like that, with some options about rotation inheritance, elasticity, collisions, etc. Then the camera could be put as a child of this node. WDYT?
I could work on this.

@QbieShay a dedicated node for it would be more flexible than bundling it with a camera I think.

@Noshyaar yes, good point :) I'll probably do this as a GDScript initially, since i'm not confident enough to mess with the engine code right now.

@QbieShay I agree with @Noshyaar, a dedicated node would enable people to use it for any number of things. And thanks for looking into this!

Hi, i started working on the spring node. For now it is really basic but i hope it solves some of the problems :) planning to make it a builtin node soon (TM).

https://github.com/QbieShay/GodotSpringArm

Hi, i made a first version of the Spring Arm for Godot. Right now, it position itself on the back of the target, using the target's up vector as up.

How would you like to configure the Node? For example, would you want a way to configure if it should rotate around the target or not?
Would you want to specify a vector for its position?
Would you want to be able to tell it which up vector to use?

Hello everyone! After some time and some input, @Andrea and I implemented the spring arm node as a built in node. If you can, please check out this https://github.com/godotengine/godot/pull/18822

Feedback is appreciated!

Was this page helpful?
0 / 5 - 0 ratings