0 votes

Example: "Player is in the current scene, and when the player move to the edge, he's in another scene".

in Engine by (25 points)

2 Answers

+1 vote
Best answer
by (698 points)
selected by

thanks for the help.

0 votes

With Escoria you can do something like this... I made a level exit scene with a cool arrow marker that has animations etc. When the player walks too far to the left of that marker I make a call to vm.run_event()

vm.run_event basically lets you run things the same way as using a .esc file, it just has a tricky "event" format.

So at the top of my scene script for the level_exit I have:

export(String, FILE, "*.scn") var scene_file

then in your function call wherever you trigger the scene change do:

var vm = gettree().getroot().getnode("vm")
event = [{"name":"change
scene", "params":[scenefile]}]

That triggers a scene change just like in a .esc file for an object I think but without requiring the player to use the object etc. I just trigger it by proximity instead.

by (20 points)
edited by
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.