in my game when i want to reset my ball position to its default position, using body.set_position()
function when user pushes R key, the position changes for a moment and then it returns to previous position when i release the key. in godot 2.1.4 everything was fine but in godot 3 i face this problem. here is my code:
extends RigidBody2D
onready var ball=get_node("/root/node2d/ball")
const ball_def_pos=Vector2(515,245)
func _set_def_pos():
ball.set_position(ball_def_pos)
func _physics_process(delta):
if Input.is_action_pressed("restart"):
_set_def_pos()
this code is attached to my character body and ball is a rigidbody, i tried to use _fixed_process(delta):
instead of _physics_process(delta):
but it returns "nonexistence function setfixedprocess in base RigidBody2D"