I want to write code that spawns a ball at the same place as my paddle

Godot Version

4.3
i could really use some help knowing what i messed up

here is the error
Invalid access to property or key ‘positiion’ on a base object of type ‘CharacterBody2D (ballphysics.gd)’.

and here is the code

extends Node2D

var ball = preload(“res://scene/ball.tscn”)#how i link to the ball tscn for spawning
var newinstance = ball.instantiate()

.
func _process(delta: float) → void:
if Input.is_action_just_pressed(“shake”):
ball.instantiate()
newinstance.positiion.x =$Paddle.position.x
add_child(newinstance)

Read the error message again, you misspelled parameter name position.

1 Like

Thank you very much i owe you it would have taken me another hour to find that if it werent for you

1 Like

No problem, glad to help! Mark my response as a solution to your problem, so that others know it’s already resolved.

2 Likes