How do I make the bullet behavir object fly to sprite

Get help using Construct 2

Post » Fri Jul 17, 2015 9:52 am

Hi,

I set a Sprite which will create randomly every 2 sec, when I touch it, it destroy and spawn the coin, I give the coin a bullet behavior which I want it fly to the coinBar(fixed position), as the Sprite create in randomly place, how can I set Bullet behavior's angle for coin? please help, thanks

file:
https://www.dropbox.com/s/thxffz0b45oav ... .capx?dl=0

thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Fri Jul 17, 2015 10:05 am

You could set the angle of the object:

coin set angle towards object coinbar
coin set angle towards position coinbar.x, coinbar.y

Or if you don't want to set the angle on the object itself,
you could set the angle of motion of the bullet-behaviour:

coin bullet set angle of motion: angle(coin.x,coin.y,coinbar.x,coinbar.y)
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 » Fri Jul 17, 2015 3:01 pm

thanks, I did not find the "coin set angle towards object coinbar" only find angle towards position, would you please tell me where is it? thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Fri Jul 17, 2015 3:05 pm

You're right.. Could have sworn there was a "set angle towards object" action, might be a behaviour thing instead..
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 » Sat Jul 18, 2015 6:28 am

ok, got it, thanks
B
11
S
3
Posts: 172
Reputation: 1,178


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 10 guests