![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Pinandu |
Next problem after change to godot 3.1
W 0:00:03:0671 The method set_friction has been deprecated and will be removed in the future, use physics material instead.
scene/2d/physics_body_2d.cpp:634 @ set_friction()
Balls.gd:9 @ add_Ball()
MenuSchlaeger.gd:57 @ _input()
this means this : var ball = BALL_SCENE.instance()
What do I have to do to avoid the error?
The Ball is a rigidbody2d node
extends Node2D
const BALL_SCENE = preload("res://Szenes/Basis/Ball.tscn")
const BULLET_SCENE = preload("res://Szenes/Basis/KanonenBall.tscn")
# Sounds
const Maeeeeh = 10
func add_Ball(pos, vel):
var ball = BALL_SCENE.instance()
ball.position = pos
ball.linear_velocity = vel
add_child(ball) # Der Ball wird dem Spielfeld hinzugefügt
ball.add_to_group("alleBaelle")
get_node("/root/Main/AudioPlayer").playSound = Maeeeeh