How do I set bullet angle of motion?

Get help using Construct 2

Post » Sun Aug 23, 2015 6:10 am

I am trying to fire bullets at various angles with respect to the player's angle to simulate a shotgun effect.

If I simply spawn a bullet with set angle=yes, then it fires in the direction the player is facing. That's great but I would also like a bullet to fire 30 degrees off from that angle.

I have tried:

Spawn Bullet on layer 1
Set Bullet angle of motion to player.Angle + 30 degrees

I've tried it this way and in the opposite order. Neither does anything but fire the bullet in the player direction.
B
6
S
1
Posts: 33
Reputation: 495

Post » Sun Aug 23, 2015 6:22 am

It works when I change 'Set angle' to No.
B
6
S
1
Posts: 33
Reputation: 495

Post » Sun Aug 23, 2015 6:53 am

I am guessing that your bullets are not yet moving when you are setting the angle of motion ? If they have zero motion (velocity) then they cannot have an angle of motion. This was the explanation I got

"The bullet's angle of motion is based on it's x and y velocity. If a bullet isn't moving then what is it's angle of motion? Think about it.

And you have the bullet property 'set angle' = 'yes' - "Set the objects angle to the angle of motion".
So when the bullet isn't moving, it's angle of motion = 0 and it's angle gets set to 0."

This lesson was provided by @Ramones ...

"But now I am the master!" (but only a master of evil ?) mmmmmwwwwahahahahahaha
(Sorry, it's early and I am still on my first coffee and have not had my anti-silly pills yet)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Aug 23, 2015 1:40 pm

Yeah. I had 'set angle' set to Yes.

When I changed it to No it worked. Prior to that I was setting the angle before and after the bullet spawn but neither worked.

Thanks for the insight
B
6
S
1
Posts: 33
Reputation: 495

Post » Sat Sep 05, 2015 1:00 pm

For the "set angle of motion" action to work, you need to first set the speed of movement > 0.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,329
Reputation: 71,300


Return to How do I....?

Who is online

Users browsing this forum: Akia410 and 10 guests