Jump to content
  • Advertisement
Sign in to follow this  
CharlieR

Unity Projectile / Bullets - How Do I? (SOLVED)

This topic is 3893 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

Advertisement
Hey Barius, thanks for the attempt.

Your right sorta, but for some hobunk reason my coordinate system seems to be funnified.

Anyway, i originally used cos, but found that tan was the correct function for my particular implementation.

In any case, I would really rather do this with vector math. I'm just lost as to how to do it. From what I can tell, it is trivial to do with vectors. If anyone can point me in the right direction (pun intended), I'd apreciate it greatly.

Share this post


Link to post
Share on other sites
I maintain a position and direction (3D) and speed (scalar) for each projectile.

For each frame (or general time interval, I don't know what's appropriate for you), I check for the intersection of each projectile with each object of interest. For each object, I maintain a bounding box or sphere and a mesh of triangles for the actual object.

First I check if the projectile is close enough to hit the object in this time interval (a quick cull) - intersection of a vector with a sphere or box.

If not culled, I check intersections with the object's mesh triangles.

Is that helpful?

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!