Inherited export variables not reflecting changes made in editor?

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

I have some script “Jumpable” which has some variables

export(float) var hang_time : float = 3
export(float) var jump_speed : float  = -400

I have a script Deer and a script Player which both extend Jumpable, I’ll use the player as an example

extends "res://Scripts/"

export (int) var run_speed = 100

So hang_time and jump_speed both show up as values to be changed in my editor for the player

but the changes I make in the editor don’t affect the script at all, instead they retain their default values. But when I make changes to run_speed(which is not inherited, but specific to the Player) all works well. So I think this is a problem related to the fact that I’m inheriting these export variables. Thanks in advance.

:bust_in_silhouette: Reply From: Eric Ellingson

Is there a Jumpable.tscn scene that the script is attached to? If not, create one, and then use the Scene > New Inherited Scene... menu option, select Jumpable.tscn to create a new scene which inherits Jumpable.tscn. You can change the node name, then and save it as Deer.tscn or Player.tscn. From the new nodes, detach and create and attach new script, and from that new script extend

Following those steps works for me.

I’m not sure why but I’m able to override the Player’s value in my game scene and it works, but I can’t for the Deer. Maybe I’m missing something. Check out the pictures below.

Imgur: The magic of the Internet

Wasiim | 2019-11-03 03:51

Ah, when I didn’t create a Jumpable.tscn scene, it worked. Maybe it’s because I had Jumpable.tscn on a KinematicBody2D, rather than a plain Node? who knows.

Wasiim | 2019-11-04 14:50