How do I create arrows

Get help using Construct 2

Post » Wed Jul 19, 2017 5:33 pm

Hi guys I have a bow and a arrow mechanism for my character but what I would like is when I shoot an arrow up it will eventually curve back down of shoot back down depending on the angle I shoot it at. Does anyone know how to implement this?
Image
B
24
S
13
G
11
Posts: 280
Reputation: 8,691

Post » Thu Jul 20, 2017 7:50 am

You could do this a lot of ways... the easiest way would be to use physics plugin for your arrows and it will handle this by itself. You would just have to set the parameters for things like gravity etc, until you are satisfied with the behaviour.

You could also do this using the QARP expression. There are a few examples of using QARP floating around, but you can also read the manual entries about QARP as well. I would link you, but I'm at work and not supposed to be forum posting right now, lol!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Thu Jul 20, 2017 7:18 pm

@SoldjahBoy Hi dude I have tried this but it doesent quite work I imply a troque towards the ground and the arrow curves like I wanted but when I shoot the arrow to the right it doesent curve for some reason
Image
B
24
S
13
G
11
Posts: 280
Reputation: 8,691

Post » Thu Jul 20, 2017 11:40 pm

You need a "heavy" end of the arrow... you could try making the arrow head one object with a little more mass than the rewst of the arrow... attach them together with a hinge/joint... and presto (maybe?).

You could do it mathematically using QARP to make a nice arc based on some level of "power" from the shot (a bit like scorched earth or similar games where you pick an angle and a power).

There's probably other/better ways to do this... but I'm a redneck engineer xD

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Sun Jul 23, 2017 1:20 pm

Use the bullet behaviour and change the gravity value.
B
8
S
1
Posts: 5
Reputation: 694

Post » Mon Jul 24, 2017 5:10 am

@videf this sounds interesting. How do you change the angle though gradually so it looks quite smooth?
Image
B
24
S
13
G
11
Posts: 280
Reputation: 8,691

Post » Mon Jul 24, 2017 6:27 am

LaurenceBedford wrote:@videf this sounds interesting. How do you change the angle though gradually so it looks quite smooth?


My clunky way (hopefully will come along and will show a more elegant way):


Code: Select all
create variable (number)

every 0.1 second:
- variable = variable + 1

every tick:
- self.angle+variable
B
27
S
6
G
7
Posts: 678
Reputation: 5,651

Post » Mon Jul 24, 2017 7:19 am

https://www.dropbox.com/s/pn6n2e2hqewquc1/Dynamic%20arrow.c3p?dl=0 Hi guys heres a working capx and thanks for everyone who helped me on this cool affect! :D
Image
B
24
S
13
G
11
Posts: 280
Reputation: 8,691


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, marc254, tarek2, Yahoo [Bot] and 28 guests