Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ispilantebrusli |
Hello, i started using godot like a week ago and im working on a simple game (obs watching tutorials on yt).
I have a Menu scene (which contains 3 buttons, Start, Option, Exit) and a World scene (which contains the Player/Monsters/Bushes etc). Selecting start will change the scene from Menu to World, if the player dies from the World to Menu. (works fine)
The problem is when i select Start button again, the player is not starting with the full HP like before.
The code is quite big so i’ll use the Pastebin (i hope it’s ok to do that) and some Printscreens to see how i organized the nodes.
Player script: extends KinematicBody2Dexport var MAX_SPEED = 80export var acceleration - Pastebin.com
Player scene: PlayerScene - Album on Imgur
SceneTransition script: extends ColorRectexport(String, FILE, ".tscn") var next_scene_pathonread - Pastebin.com
PlayerStats script: extends Node2Dexport(int) var max_health = 1 setget set_max_health #de fieca - Pastebin.com