0 votes

Basically i want to make the scenes change when a rigidbody enter an area. I have it done basically but my scene_count variable doesent change. Please help and tell me what i am doing wrong.

Here is the code:

extends Spatial

var currentlevel = 1
var scene
count = 1
var scene_state = false

Called when the node enters the scene tree for the first time.

func _ready():
$Panel.hide()

Called every frame. 'delta' is the elapsed time since the previous frame.

func process(delta):
if Input.is
keypressed(KEYENTER):
gettree().reloadcurrentscene()
if Input.is
keypressed(KEYR):
gettree().changescene("res://main.tscn")

func onAreabodyentered(body):
print(scenecount)
if body is RigidBody:
get
tree().changescene("res://main" + str(scenecount) + ".tscn")
scenecount += 1
if current
level == 3:
print("Win")
$Panel.show()
if gettree().currentscene.getname() == "main":
current
level = 1
if gettree().currentscene.getname() == "main3":
current
level = 3

in Engine by (12 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 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 webmaster@godotengine.org with your username.