friction has been deprecated and will be removed, error after switch to godot 3.1

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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() @ add_Ball() @ _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
	get_node("/root/Main/AudioPlayer").playSound = Maeeeeh
:bust_in_silhouette: Reply From: kidscancode

The error means exactly what it says. As of 3.1, physics properties have been moved to a Resource: PhysicsMaterial.

You can see an example of this in use here:

i make in the Ball.tscn a PhysicsMaterial, saved it, that solves my Problem

Pinandu | 2019-04-13 08:30