Problem with calculating bullet distance from origin

Get help using Construct 2

Post » Sat Jan 24, 2015 6:27 am

Hi there,

I'm having some trouble with a prototype I'm working on.

Which you can grab here: https://drive.google.com/file/d/0B_Xd56ZdrBpYQ1dIb2l4cnpKajA/view?usp=sharing

There idea is that when you click the left mouse button, the flytrap shoots his tongue (or more importantly the tongueTip object, a bullet). The tongue's width is supposed to always remain the distance between the bullet and it's origin, the flytrap (turret).

The problem is that the tongueTip object's x and y positions appear to not be updating. I made a global variable and linked the tongue's width to that , but no luck.

The debug shows that neither the global variable, or the x and y positions of the tongueTip are updating, despite the fact that it's moving across the screen.

Would love any help I can get.

Thanks in advance
B
10
S
4
G
5
Posts: 139
Reputation: 2,983

Post » Sat Jan 24, 2015 7:04 am

it's because of the instances you have off the side of the layout (their distance never changes). on start of layout, destroy the tongue and tongue tip and it works.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Sat Jan 24, 2015 7:13 am

Beautiful, I knew it was something dumb I was doing.

Thanks man!
B
10
S
4
G
5
Posts: 139
Reputation: 2,983


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 48 guests