How do I set the angle for bullet behavior?

Get help using Construct 2

Post » Wed Sep 02, 2015 9:41 am

I've encountered an interesting problem I can't solve for some reason. As you can see on the image below, in this function I pick all of the instances of the "babu" object which fulfill the expression and for each of these, I set 2 coordinates from an array (the object has another 2 coordinates already stored in the kezdo_X and kezdo_Y instance variables).
After that, I try to set the angle of motion for the bullet behavior using the angle() expression with these 4 coordinates. The problem is, that the angle will always be either 0 or -180 in the behavior (checked in debug mode). However, the coordinates gets loaded into the variables just fine, and when I write out the angle() expression's result, it displays the correct angle. Is this some problem with the behavior I don't know about? I've already tried using int() before the angle() expression, and using the custom movement behavior I get the same results.

Any help would be appreciated. Thank you.

Image
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Fri Sep 04, 2015 7:57 am

I recently encountered the same problem. The issues seemed to be related to the particular layer that I was using. All of my layers did not have the same parallax value. I didn't really understand why that was causing the problem but I tried changing the layer that the object using the bullet behavior was using and then it worked fine. I don't know if that is the issue for you and it may be a bug with the latest stable release. I was unable to replicate it to report it as a bug and I encounter the problem twice in the last week. Just thought I'd share that with you
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat Sep 05, 2015 8:50 am

@TheDom I figured out that if you set the angle with speed 0, it ignores it. I'm not sure that this is how it should work, so I filed a bug report:
bullet-behavior-angle-only-sets-if-speed-is-greater-than-0_t153324
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Sat Sep 05, 2015 10:34 am

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
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Sat Sep 05, 2015 12:13 pm

@RamPackWobble Thanks, now I see why it behaves like that.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Sat Sep 05, 2015 12:55 pm

After another look - try swapping the set speed to above the set angle or look at using set angle rather than set angle of motion.
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
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Sat Sep 05, 2015 1:01 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
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Sat Sep 05, 2015 3:23 pm

@Kyatric
Yes, I realized it earlier today (but still, thanks), nonetheless I didn't find any information about this in the manual, which would be useful in my humble opinion.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to How do I....?

Who is online

Users browsing this forum: Fradno, HellMax, marcinkowski and 13 guests