make sure the player is only 1 instance, and that the value is available at all times to be read, meaning the attackspeed variable of the player should be static not changing.
it should work, but is not great practice to use direct instance varible of other objects as those other objects get destroyed etc and then all ur data is lost that u are based ur other items to depend on.
better have the character stats like "attackspeed" saved as a array or global variable then use that on ur bullet behavior.
and to use that u need to make sure the data is set on bullet creation. in a proper order
u cant have
bullet set speed to player.attackspeed above the line that creates the bullet.
always needs to be after bullet is created. otherwise will change all bullets in screen, or give u weird glitches.
FIY the setting of bullet speed can be done using events
<condition> on bullet created /spawn etc < action > set bullet.speed to player.attackspeed
hope it helps.
Thank you, this helps a lot. I notice that the global variable says 'static'. So if I have a playerHealth global variable and I set it to '100' and 'static', does that mean I cannot change it when the player gets hit by a bullet?