bullet angles

For questions about using Classic.

Post » Wed Sep 23, 2009 2:59 am

When I tell my script to change the angle of a bullet, if there are multiple bullets then it changes all of the angles, how do make it only change the current bullet being shot?
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Wed Sep 23, 2009 3:14 am

if you mean shot by another sprite's "spawn object" action, then as long as you put the angle change in the same event as the "spawn object", it will only apply to that one

if there is a different situation, where you need the angle to change after this event, there would be a different solution, but we'd need extra details to find it

also, btw, unless you mean Python script, just call it "events"
or people may be confused as to whether or not you mean python script or events

and welcome to scirra. :mrgreen:
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Sep 23, 2009 3:23 am

Oh, I figured out why it's happening, but now i don't know how to solve it. Here's the .cap.
TestGun
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Wed Sep 23, 2009 4:08 am

You should be setting the angle after you create the new object. Since the new object doesn't exist when you set the angle, Construct is picking all instances of the bullet object that currently exist.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Wed Sep 23, 2009 5:34 am

That was a lot easier than I thought it would be.
B
7
S
2
G
3
Posts: 139
Reputation: 2,331


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests