How do I set angle of motion for bullet

Just started using Construct 2? Post your questions here

Post » Mon Aug 03, 2015 3:04 pm

The bullet keeps changing angle as the character changes his!

I set the "Set Angle" to "No" and do it like this.

Image

How should I do it then?
B
9
S
1
Posts: 17
Reputation: 521

Post » Mon Aug 03, 2015 3:09 pm

If this is the only event affecting the bullet angle of motion it will only change on the moment the space bar is pressed..

So every time the space bar is pressed all bullets on screen will set their angle of motion to the angle of tutu..

I'm not sure what you want to change about this, so more explanation is nescessary..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Aug 03, 2015 3:16 pm

LittleStain wrote:If this is the only event affecting the bullet angle of motion it will only change on the moment the space bar is pressed..

So every time the space bar is pressed all bullets on screen will set their angle of motion to the angle of tutu..

I'm not sure what you want to change about this, so more explanation is nescessary..


You just explained the whole thing impressively!

What I wanted is to make the bullets that were spawned on the "Spacebar" press to keep going to the end of the layout rather than changing angle when the character changes his angle and "Spacebar" is pressed again.
B
9
S
1
Posts: 17
Reputation: 521

Post » Mon Aug 03, 2015 4:22 pm

I explained what the event you created does..
If you want it to do anything different, you should change the event..

You could solve it by by:

on spacebar pressed
> spawn bullet
> bullet set angle of motion..

or

on bullet created
> bullet set angle of motion

or any other event referencing the bullet you want to affect..
Right now there is no reference to the bullet, so all bullets are affected.

By placing it under the create action, the bullet in the next line is the one just created..
By using the on created event, you are referencing the bullet..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Aug 03, 2015 5:55 pm

LittleStain wrote:I explained what the event you created does..
If you want it to do anything different, you should change the event..

You could solve it by by:

on spacebar pressed
> spawn bullet
> bullet set angle of motion..

or

on bullet created
> bullet set angle of motion

or any other event referencing the bullet you want to affect..
Right now there is no reference to the bullet, so all bullets are affected.

By placing it under the create action, the bullet in the next line is the one just created..
By using the on created event, you are referencing the bullet..


Solved all thanks to you. LittleStain

I did as you said and made the "Set Angle" request to be after "On created"
B
9
S
1
Posts: 17
Reputation: 521


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests