Rick Posted June 3, 2010 Share Posted June 3, 2010 I have the swat model from Dexsoft. http://www.dexsoft-games.com/models/swat.html The gun is attached to the model and currently the gun has no bones. I have an idea of how I will handle shooting but curious on what other ideas people have. My plan was to add 2 bones to the model. One right in front of the gun barrel and another directly in front of that one. I'll find these 2 bones from code and by subtracting their positions I'd be able to get the direction the weapon is pointing. Then if I multiply that vector I can get an end point vector for the raycast. So I guess that's my issue. Getting the start and end vectors for the "bullet" fired from the gun. Quote Link to comment Share on other sites More sharing options...
paramecij Posted June 3, 2010 Share Posted June 3, 2010 I would just add one (correctly oriented) bone at the end of the barrel then call EntityPick with the barrel bone and the range of the weapon.. that would be my first try Quote Link to comment Share on other sites More sharing options...
ZioRed Posted June 3, 2010 Share Posted June 3, 2010 Shouldn't the weapon (and then the bullets) point to the center of screen when firing in 1st person (or at mouse click coords in 3rd person)? Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Rick Posted June 3, 2010 Author Share Posted June 3, 2010 ZioRed, Sorry, this is sort of top down view, and I'm not using the mouse to determine where to shoot. The rotation of the character determines the direction, and the distance will just go a range that is slightly outside the camera viewing area. paramecij, good idea. I was looking at LinePick where 2 points are needed, but LinePick will handle shooting directly forward so that should work. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.