Topic was automatically imported from the old Question2Answer platform.
Asked By
Dudedude123
I’m scripting the teams in my basketball game
# Called when the node enters the scene tree for the first time.
func _ready():
if offense:
current_player = has_ball
Globals.player ==
{
frontcourt,
backcourt,
center
}
for body in phys_area.get_overlapping_bodies():
if body is RigidBody:
ball = body
return
if has_ball:
has_ball.global_transform.origin = holding.global_transform.origin
#pass Replace with function body.
Globals.player ==
{
frontcourt,
backcourt,
center
}
What are you trying to do there? The braces ( {} ) make it look like a Dictionary, but the element assignments aren’t valid. Also, that == should likely be =. This is valid Dictionary syntax, but again, I’m not sure what you’re expecting to do there.
You can’t split the line on an operator.
This is also the wrong operator. == is a comparison operator. You need the assignment operator =
Try changing to this: