- Edited
Hello, thanks for any and all help.
I'm trying to understand why something isn't working, not because I can't solve it in a different way, but rather because If I don't figure this out it can cause blockades down the line, and I also want to grow my knowledge of the engine.
I have these two scripts...
Bullet has an EXPORTED Bullet.speedDefault and a Bullet.speed that gets initialize by the default. This Bullet.speed is what's actually used for calculations. It also has a function to "fire" itself, but it might not be relevant for this problem...
Gun preloads the Bullet PackedScene and then uses it when a shoot functions runs. Inside this shoot() function, a Bullet is instanced, and then its Bullet.speed value is called to help set its impulse...
HERE'S WHAT I DON'T GET No matter to what I set the speedDefault of the bullet scene in the EDITOR, it will always just use the hard coded values set on the script (in this example 1000). And I don't know why this could be happening?
Why isn't my bullet instance using the speedDefault value I set on the editor scene? Is it because of preload in any way? Is it because instancing? How do I get this to work with the exported speedDefault? I would prefer to use exported than hard coding anything...
PS: I made sure everything was saved and tried to set the Bullet.speed in the _ready() function, but it still ignores the editor set value.