Help me with simple Text issue???

Get help using Construct 2

Post » Mon Feb 04, 2013 12:53 am

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!
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Mon Feb 04, 2013 1:01 am

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 !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Feb 04, 2013 2:06 am

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.

???
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Mon Feb 04, 2013 4:14 am

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?BenGIJOE2013-02-04 04:16:15
B
5
S
1
G
1
Posts: 12
Reputation: 899

Post » Mon Feb 04, 2013 8:21 am

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.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Mon Feb 04, 2013 9:57 pm

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

Thanks to both of you!!
B
10
S
3
G
3
Posts: 29
Reputation: 2,692

Post » Mon Feb 04, 2013 10:19 pm

@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.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973


Return to How do I....?

Who is online

Users browsing this forum: makkancs, rekjl and 27 guests