Ball Possesion - Basketball Game

Godot Version

Godot 4.4

Question

I’m having trouble figuring out how to do ball possession for my basketball game, Right now I have ball with most of the physics figured out (I think) and a player character that has basic 3D game functions (Move, Jump, Working Camera)

I’m trying to approach the problem by using a SpringArm3D to keep the ball a specific distance away from the player but I don’t know how to get everything working.

extends SpringArm3D
var DribbleSpeed = 0.0
@onready var PlayerCode = $"character_body_3d.gd"
@onready var BallCode = $"ball.gd"
@export var Ball: Node3D

This is what I have currently for the SpringArm and I can’t find anything that might point me in the right direction for coding this.

Sorry if this isn’t the proper place for this
Thanks in Advance

Your nodes cannot have dots . in their name, so these node paths must be incorrect.

Make sure to paste any errors you receive. SpringArm3D does not need any code to collide and move child nodes, it does not “bounce” on it’s own if you are expecting a spring-like animation from it, only moves as far as it can until colliding or the max target distance is reached.

If you want to animate bouncing maybe using an AnimationPlayer would serve you better.

Thanks for the help, the BallCode and PlayerCode variables are both linked to their respective scripts that way I don’t have to redefine variables in the code here.

I’m not trying to get the ball bouncing right now I’m just trying to keep it at a steady, consistent distance from the player character when they have possession of it.