Results 1 to 9 of 9
  1. #1

    Blender 2.6 Ray Sensor for Bullets

    Hi, I have been trying to get a physical bullet working in blender for the longest time and cant get it to work unless its traveling the speed of a bowling ball. I've found that people suggest using a Ray Sensor for Bullets. I've searched through the forums and Google but cant find any tutorials or working scripts. I'm still new to python so if you have a script please post instructions on how to make it work too. Or if you have any other suggestions please let me know!
    Thanks!



  2. #2
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    10,679
    I think each FPS templates uses this method. Have a look at the resource forum.

    Beside that, you should tell us what you want to achieve.



  3. #3
    You should take a look at my ray sensor video tutorial: http://www.youtube.com/watch?v=dAdiCrVGN20

    So, you just have to take the hit position of the ray, and use a method like applyImpulse to add a physics effect.

    *Note: last time I checked, applyImpulse was acting in local space, even though the documentation states that "world coordinates" are used. I actually posted a patch for that, but I don't know if the bge devs picked up on it.
    Game Dev video tutorials -> http://www.youtube.com/goranmilovano



  4. #4
    Sorry I should have been more clear. I've never used an FPS template, I just always thought it would be to complicated. I'm trying to learn python but its going slow. All I'm trying to do at the moment is make a practice range and wanted the targets to fall over when I shoot them and make bullet holes when you shoot stuff and dust fly up when you hit the ground. This stuff is easy when your using a physical bullet but it doesn't always work, like going through walls without collision detection. I'll get an FPS template and see if I can get it to work.
    After I get this down it wouldn't be that much trouble to add people in it would it? So when I shoot them they play an animation or go to ragdoll?
    Thanks!



  5. #5
    Thanks I'll take a look at this too!
    Originally Posted by Goran View Post
    You should take a look at my ray sensor video tutorial: http://www.youtube.com/watch?v=dAdiCrVGN20

    So, you just have to take the hit position of the ray, and use a method like applyImpulse to add a physics effect.

    *Note: last time I checked, applyImpulse was acting in local space, even though the documentation states that "world coordinates" are used. I actually posted a patch for that, but I don't know if the bge devs picked up on it.



  6. #6
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    10,679
    Originally Posted by SomeOne51 View Post
    I've never used an FPS template
    You do not need to use it. Just look how it is done there. Then try to implement this or a variation in your game.



  7. #7
    Isn't using rays the easy (half) solution?
    In other words, isn't there a better more accurate solution, which involves ballistics?

    Realistic Bullet Ballistics (instead of hijacking)



  8. #8
    Thank you Goran! This works perfect! Great tutorial too!
    Originally Posted by Goran View Post
    You should take a look at my ray sensor video tutorial: http://www.youtube.com/watch?v=dAdiCrVGN20

    So, you just have to take the hit position of the ray, and use a method like applyImpulse to add a physics effect.

    *Note: last time I checked, applyImpulse was acting in local space, even though the documentation states that "world coordinates" are used. I actually posted a patch for that, but I don't know if the bge devs picked up on it.



  9. #9
    How would I make a delay of the bulletholes based on distance to the object?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •