Advertisement Jump to content
Sign in to follow this  
plusplos

Fire projectile in front of target rather than at target

This topic is 1655 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

 

I'm having a slight issue in calculating the speed and vector of a projectile to ensure it will always hit a moving target.

 

Assuming all speeds are constant, with only and x and y axis, and are moving in meters per second:

 

If I fire a projectile at my enemy, at a speed of 10m/s, that is 20 meters away and the enemy is moving in a straight line at 10m/s.... how can I find the projectile's moving vector to ensure that the projectile and the enemy meet at the same point?

 

I hope it makes sense, let me know if anyone needs anymore explanation.

 

Thanks for any help!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!