Jump to content

bullet shooting


Rick
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...