How to "PickWhip" a parameter to another parameter

Godot Version

4.3

Question

Hiya! I come from a motion graphics background in After Effects, and I was wondering if Godot has any potential feature like AE does called “Pickwhipping”

this YT video is a great explainer to what it is for pickwhipping properties in the software (2:30-2:45)

To summarise my question, I was wondering if Godot fields have some form of expression control available to them, and if so how I can go about setting that up?

I understand that there’s a lot of ways to do this programmatically, but I was hoping for a solution that the engine understand on a more holistic level.

For a running example, If you’re in the “Godot Engine” discord I have a post on this too linked here.
The quick explainer is i have a “Floor” scene, that contains:

  • A MeshInstance3D for visual representation of the Floor
  • An Area3D instance, with a CollisionShape3D for collision on this floor
  • The Floor scene has a script attached which exports two floats “length” and “height”

What I’m hoping for here, is some way I can “bind” / “pickwhip” the MeshInstance3D and the CollisionShape3D’s size parameters to follow the root scene’s size parameters whenever they update.

My imagination here would be that even in engine if i were to change the length & height property, the 3D Scene viewer would automatically update as the values would be calculated correctly.

Thanks for any help! If not i’ll be able to figure out my own programmatic solution such as using _process() or signalling changes, so although welcome, programmatic solutions aren’t necessarily what i’m looking for here

Thanks again :slight_smile:

  • ramar

If you want to make changes to nodes via script while in the editor you could use tool scripts. Using a setter/getter for your changes in scale would make your script way more performant than using ‘process’.
This would be an example for a script running in the editor and changing attributes of other nodes like the scale (you have to reload your project after any changes on the tool script for them to apply):

@tool


@export var node_a : Node3D
@export var node_b : Node3D

@export var custom_scale : Vector 3
   set(new_scale):
      custom_scale = new_scale
      node_a.scale = custom_scale
      node_b.scale = custom_scale
   get:
      return custom_scale

I hope this works for you even though it’s a ‘programmatically’ approach :slight_smile:

1 Like

amazing! this does exactly what I’m looking for, i didn’t even know Godot had setters as well which makes this give me the full control I was secretly hoping for too. thanks so much!