–1 vote

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 _physics
process(delta):
velocity.z = enemyspeed
moveandslide(velocity)

Godot version v3.5
in Engine by (11 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.