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

0 favourites
  • 4 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi 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?

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)