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():

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

func process(delta):
if Input.is
if Input.is

func onAreabodyentered(body):
if body is RigidBody:
tree().changescene("res://main" + str(scenecount) + ".tscn")
scenecount += 1
if current
level == 3:
if gettree().currentscene.getname() == "main":
level = 1
if gettree().currentscene.getname() == "main3":
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.