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
31
S
16
G
12
Posts: 318
Reputation: 9,854

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
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

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
31
S
16
G
12
Posts: 318
Reputation: 9,854

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
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sun Jul 23, 2017 1:20 pm

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

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
31
S
16
G
12
Posts: 318
Reputation: 9,854

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
My latest game is: Plants at www.rogerty.com
B
28
S
6
G
7
Posts: 683
Reputation: 5,686

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
31
S
16
G
12
Posts: 318
Reputation: 9,854


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests