Reload 3D scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By toivocat

So I’ve been making my first 3D game. And it’s sort of a parkour so when you fall I need it to reload the level. I know how to reload the scene for 2D so I thought it would be the same thing. So I tried to just do get_tree().reload_current_scene() on a Area node. But it didn’t work and the player just fell through the Area node. So I need to know how to reload 3D scenes.

I don’t know much about 3D, but what if you tried executing that code in the root node of your scene?

TheJokingJack | 2021-08-09 17:21

What do you mean? The Area that restarts the scene is in a different scene.

toivocat | 2021-08-09 17:58

Don’t you have to execute the

get_tree().reload_current_scene()

in the same scene?

TheJokingJack | 2021-08-09 18:09

Yes I did but it didn’t work the player just falls through the Area node.

toivocat | 2021-08-09 19:23

Maybe the area2d isn’t triggering - try to print some text to see if it works correctly.

Snail0259 | 2021-08-09 22:11

It’s an Area node not an Area2D

toivocat | 2021-08-09 22:53

What about trying the same code in different functions? At a specific point in time? When the spacebar is pressed? When the scene enters the tree? Or in different nodes?

TheJokingJack | 2021-08-09 23:00

It’s not detecting the collision

toivocat | 2021-08-09 23:02

Wait, hold up, the Area node is not a collisionobject. A player is supposed to fall through the Area node. What are you trying to do? Why are you trying to reload the scene and then say that the player is falling through the Area node?

TheJokingJack | 2021-08-09 23:07

So there is the Area node. And it needs a collision shape but I’m using onbodyentered() but that isn’t detecting the collision have to turn it off now having dinner

toivocat | 2021-08-09 23:10

:bust_in_silhouette: Reply From: uniquegamesofficial

Try: get_tree().change_scene(.....)

That’s not what I want to do. I want to reload the 3D scene but the onbodyenterd(body) won’t detect the collision.

toivocat | 2021-08-10 14:33