ghin's Recent Forum Activity

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would like to set the bullet speed to a player object's instance variable 'AttackSpeed' which will be some other arbitrary number. I find that i can only enter in numeric values for speed, and if I type something like Player.AttackSpeed which I thought would work, it automatically gets reset to 200. Is there anything else I can do to resolve this?

ghin's avatar

ghin

Member since 21 Jan, 2025

None one is following ghin yet!

Trophy Case

  • RTFM Read the fabulous manual
  • Email Verified

Progress

2/44
How to earn trophies