How do I Fix this bullet behaviour problem

Get help using Construct 2

Post » Sun Nov 16, 2014 6:20 pm

Hi. When end of touch it enables bullet for arrow . The arrow hit a wall and got pinned and disables bullet behaviour.
When i shot again it enables bullet again and the arrow that is aleady pinned to a wall start rotating and doing weird things because the bullet was also activated to the pinned one. How do i make it so the arrows that are already pinned to wall will not be affected by the bullet anymore?
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Sun Nov 16, 2014 6:26 pm

Instance variable. Keep track of which of your arrows are pinned and pick accordingly before activating the bullet behavior.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sun Nov 16, 2014 7:06 pm

sorry i cant get it to work, may you explain it a bit more plz. :-/
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Sun Nov 16, 2014 8:18 pm

Can you make a capx showing just the problem? It's hard to suggest a solution without really knowing whats happening.
Are you spawning a new arrow and rotating all arrows mid-air?
B
240
S
62
G
33
Posts: 903
Reputation: 40,589

Post » Mon Nov 17, 2014 1:22 am

Here is a capx. hit the wall few times to see what is happening to the arrows already pinned
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Wed Nov 19, 2014 5:25 pm

Sorry for the delay, I missed your reply.

I added a Boolean variable to the arrow "NewArrow" default to true.
Then to each place the arrow is further manipulated, I checked "Is NewArrow"

Then after it hits the sprite, I change that arrows "NewArrow" value to false. That way only the 1 NewArrow gets adjusted.

(just noticed the arrow on the layout at the start also flys in when you shoot the first arrow. either destroy all arrows on startup, or move it under the layout so you never see it.)

Capx included:

Edit: just realized if you fire many arrows at once, there will be more than one true at a time. (this caused some arrows to go too deep or all the way through.)
You have a solution already started that does work.
Replace my "Is NewArrow" events with your "Pick Top Instance" and it works fine without the variable.
You do not have the required permissions to view the files attached to this post.
B
240
S
62
G
33
Posts: 903
Reputation: 40,589


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 17 guests