0 Favourites

Help me with simple Text issue???

  • Hi.

    I'm a n00b with this, so please be kind :o)

    I just want to display the angle of motion on a bullet sprite so I can troubleshoot something else.

    So, on the corner of my screen I have a Text Box.

    On a Bullet Sprite (BS) I've got an instance Variable called "AngleOfMotion"

    On my Event Sheet I've got:

    System - Every tick - Set AngleOfMotion to BS.Bullet.AngleOfMotion

    Below that I added the following action:

    Set text to BS.AngleOfMotion.

    But, when I run it, the text shows the initial Angle and does not refresh when the sprite changes angles. SHouldn't it refresh on every tick?

    What am I doing wrong?

    TIA!

  • Why you make things complicated ?

    Just do

    • Every ticks |

    -- Set text to BS.Bullet.AngleOfMotion

    And if you want to show the angle of the sprite , then you should do

    • Every ticks |

    -- Set text to BS.Angle

    Hope that helped ,

    Cheers !

  • I've tried both and the Text always shows up as 180 even though the sprite is moving in random directions, bouncing off walls into other diretions. It still says 180.

    ???

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Whiteclaws suggestions should work...

    They both did when I tried them.

    However, I was able to create a scenario where the debug text was stuck at one number (zero). It was because I had a bullet object outside the layout and I removed the destroy object outside layer behavior. So the text was following that bullet instead of the ones I fired.

    Not sure if you may be having a similar issue?

  • Is this a bullet sprite that is already on the layout, or is it one you're spawning. If it's one you're spawning and you didn't destroy the initial one you had in the layout it's tracking that one, which isn't changing.

  • Thanks. That was the issue. Once I destroyed the intial one outside the layout the numbers displayed correctly.

    Thanks to both of you!!

  • 30FootForest Welcome to "Learning about Object Picking the Hard Way". :) That one bit me in the behind too and I added a few grey hairs because of it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)