How do I set up a 'trajectory' prediction? (using Physics)

Get help using Construct 2

Post » Sat Nov 22, 2014 12:33 pm

I know this question comes up a lot (I've been looking around before coming here), but usually in relation to the bullet behaviour rather than the physics behaviour which is what I'm using.

Basically, I want to implement a prediction of where an object will travel after it is 'launched' from a point (A little like the aiming thing in the 'Peggle' games and such). Because the object will be effected by the gravity of other masses, I *think* I have to do this also using the physics behaviour, which opens up a few problems. By my logic, I could create a second object that has the same physical properties (parameters of the physics behaviour) that is automatically launched every few ticks when aiming the actual object to be launched, and then fades until deleted. This however spawns the problem that the aiming objects interact with other physics enabled objects, for example, sending any moveable object flying.

I was wondering if there is a way I can turn off an objects ability to move a physics enabled object without changing any parameters, or rendering the object they bounce off immovable. Alternatively, is there any other way I can set up a 'guide' of where the launched object will travel?

Any help will be greatly appreciated!
B
10
S
1
Posts: 72
Reputation: 1,014

Post » Sat Nov 22, 2014 2:43 pm

Hi @GideonG. If those other objects would move when you launch your missile then they will in turn affect the path of the missile, so if you turn off their ability to move for the "prediction trail" the prediction will not travel through the exact same physics environment. Don't know if that makes sense?
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Sat Nov 22, 2014 3:03 pm

B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Sun Nov 23, 2014 3:19 am

@hundredfold That's precisely my problem, I need the trail to be affected by all physics that apply to the actual projectile, except I need any objects it hits not to be effected, because otherwise, when aiming the projectile, it will make the other physics based objects react as if they had been struct with the actual projectile. I don't suppose there is a way to 'turn off' collisions with a particular physics based object? (in my case the trail?)

@Katala thanks for the link! Unfortunately, my project uses multiple dynamic gravity sources, so something mathmatically based like that would take incredible calculations simply beyond my ability. Thanks anyway! :)

Thanks so much for the help you guys are giving me, it's great!
B
10
S
1
Posts: 72
Reputation: 1,014


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 32 guests