another thing i used signals
um so i have a problem these blocks that move forwards at the player what its suppose to do is on body entered is loads a ui scene but it will only show to ui scene
player code:
extends KinematicBody
var velocity = Vector3(0,0,0)
func _ready():
pass
func physicsprocess(delta):
if Input.isactionjustreleased("uileft"):
velocity.x = -10
elif Input.isactionjustreleased("uiright"):
velocity.x = 10
else:
velocity.x = 0
moveandcollide(velocity)
func onAreabodyentered(body):
gettree().changescene("res://Control.tscn")
flying blocks code:
extends KinematicBody
var velocity = Vector3(0,0,0)
const enemyspeed = 10
func ready():
pass
func _physicsprocess(delta):
velocity.z = enemyspeed
moveandslide(velocity)