I think the main problem why there is no penetration is that it seems very hard to spawn a projectile from a wall. worluk told me that a more feasable and less stressy way would be to NOT remove the projectile when hitting a penetrable surface, but just "tag" it so the system knows it has penetrated and adjusts the velocity accordingly, and simply remove it at the next hit. The projectiles would move in the same vector as before, but that seems a better, and easier way to calculate some basic penetration.GuidoTorpedo said:This is how I see the system working.
Current:Future:
- User presses the fire button and the fire event is triggered.
- Based on the user's position and aimpoint, a bullet is instantiated with a starting location, initial velocity (and energy calculated from this), direction vector.
- Bullet travels to its target with a trajectory based on the weapon ballistics.
- Bullet meets its target, location of the "hit" is taken, bullet is removed and a hit "puff" replaces with with the same coordinates.
- User presses the fire button and the fire event is triggered.
- Based on the user's position and aimpoint, a bullet is instantiated with a starting location, initial velocity (and energy calculated from this), direction vector.
- Bullet travels to its target with a trajectory based on the weapon ballistics.
- Bullet meets its target, location of the "hit" is taken, bullet is removed and a hit "puff" replaces with with the same coordinates.
- If the hit target is penetratible, a vector is calculated from the hit surface to the next surface that "touches air". (as in, if you hit the front of a wall, a vector is calculated to a point in the backside of the wall there the bullet trajectory will exit.
- Subtract the energy from the bullet depending on what type of material it hit. If its zero, stop, if not, instantiate a new bullet (and exit puff animation) with a new velocity attribute and trajectory.
- Rinse and repeat.
Upvote
0