# Python: Calculate Physical Bullet Hitpoint / Needed Force

**URL:** <https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581>\
**Category:** Game Engine Resources\
**Created:** [May 25, 2024, 9:50pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581 "2024-05-25T21:50:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [May 25, 2024, 9:50pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/1 "2024-05-25T21:50:32Z")

</div>

Hi,  
Find the hitpoint of a physical bullet shot.  
[UPBGE03\_hitpoint.blend](https://blenderartists.org/uploads/short-url/eMiPP8KcB2ANXLJQ3ajlVRold9B.blend) (915.1 KB)

(UPBGE 0.3)

  

```auto
#Controls
#A/D left/right  
#A/S up/down
#Mousewheel Force
#Space shoot

#docs:
# https://physics.stackexchange.com/questions/27992/solving-for-initial-velocity-required-to-launch-a-projectile-to-a-given-destinat?rq=1
# https://forum.unity.com/threads/how-to-calculate-force-needed-to-jump-towards-target-point.372288/

```

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [May 26, 2024, 10:43pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/2 "2024-05-26T22:43:15Z")

</div>

Here is the complement opposite scenario:  
Calculate the needed Force to hit a target.  
(Video would look almost the same)  
[UPBGE03\_hitpoint\_neededForce.blend](https://blenderartists.org/uploads/short-url/tCgekt0fWyS6bgbW5D8TP5mippu.blend) (915.7 KB)

```auto
#Controls
#A/D move Target left/right  
#W/S move Target up/down
#Mousewheel Rotate canon (angle)
#Space shoot

#docs:
# https://physics.stackexchange.com/questions/27992/solving-for-initial-velocity-required-to-launch-a-projectile-to-a-given-destinat?rq=1
# https://forum.unity.com/threads/how-to-calculate-force-needed-to-jump-towards-target-point.372288/

```

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [May 29, 2024, 5:26pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/3 "2024-05-29T17:26:10Z")

</div>

variables of equations of both files are now named the same and have the same Drawline-code.

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [May 30, 2024, 11:42pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/4 "2024-05-30T23:42:42Z")

</div>

Little throw-back npc that just moves as fast as needed to be in time  
[UPBGE03\_hitpoint\_1npc.blend](https://blenderartists.org/uploads/short-url/4NdCvDcJryVP9Vpl4sxLCA7Dp9w.blend) (932.8 KB)

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [May 30, 2024, 11:46pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/5 "2024-05-30T23:46:37Z")

</div>

Great, I had all the work and now the 2 npcs play without me.  
[UPBGE03\_hitpoint\_2npcs.blend](https://blenderartists.org/uploads/short-url/fpxnQdChRHA1uyVwxxufi9XCUNN.blend) (1002.2 KB)

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [June 2, 2024, 10:42pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/6 "2024-06-02T22:42:58Z")

</div>

1 FPS Player - 1 npc  
[UPBGE03\_hitpoint\_1npc\_1player.blend](https://blenderartists.org/uploads/short-url/vUWIWEoKFWzkn71GvdNDtEL0aMg.blend) (2.7 MB)

[![](https://blenderartists.org/uploads/default/original/4X/b/7/8/b789b974b1672ec9feac49b9348e1bd99af1b03c.jpeg "VolleyBall Preparations (UPBGE 0.3)") ](https://www.youtube.com/watch?v=v3nvf3uSlm0)

```python
#Controls
#WASD Move
#Mouse look
#Space jump
#Mousewheel Force
#LMB shoot
#RMB Grab

```

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [June 8, 2024, 9:01pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/7 "2024-06-08T21:01:59Z")

</div>

Interpolated velocity between points within a given time. NPC now starts and stops smoothly instead of abruptly.  
[UPBGE03\_hitpoint\_1npc\_1player\_smooth.blend](https://blenderartists.org/uploads/short-url/3RmYqu9NDMwGQGvJQiuxjgUPEFD.blend) (2.7 MB)

---

<div class="post-metadata">

**Author:** ![musikai](https://blenderartists.org/user_avatar/blenderartists.org/musikai/32/1395660_2.png) [@musikai](https://blenderartists.org/u/musikai)\
**Post date:** [June 12, 2024, 5:25pm UTC](https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/8 "2024-06-12T17:25:25Z")

</div>

Here’s a VolleyBall Field Demo:  
[https://www.dropbox.com/scl/fi/47foculd3v6383ihfiroj/UPBGE\_0.3\_VolleyBallField.blend?rlkey=rdkoj1eqtlxl65wp2jmid3vp1&st=s0bjfn3d&dl=1](https://www.dropbox.com/scl/fi/47foculd3v6383ihfiroj/UPBGE_0.3_VolleyBallField.blend?rlkey=rdkoj1eqtlxl65wp2jmid3vp1&st=s0bjfn3d&dl=1)

[![](https://blenderartists.org/uploads/default/original/4X/1/b/d/1bdee10ed234bac5c3e31e24d2b649e63918272e.jpeg "VolleyBall Field (UPBGE 0.3)") ](https://www.youtube.com/watch?v=ZPqLTa8yCzI)

```auto
Controls:
WASD Move
Mouse look
Space jump
Mousewheel Force
LMB shoot
RMB Grab

Enter Restart Game

Credits:
VolleyBall
https://blendswap.com/blend/12793

Girl model and animation from
https://quaternius.com/packs/ultimatemodularwomen.html

Mechanics:
https://blenderartists.org/t/python-calculate-physical-bullet-hitpoint-needed-force/1531581/7?u=musikai

docs:
 https://physics.stackexchange.com/questions/27992/solving-for-initial-velocity-required-to-launch-a-projectile-to-a-given-destinat?rq=1
 https://forum.unity.com/threads/how-to-calculate-force-needed-to-jump-towards-target-point.372288/

```
