Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
TalkZer

Bullet Penetration

Question

I don't really need the code itself, i just need the logic.

How do i make that the raycast not only hits an object, but the object behind it. Like penetration?

And no, i don't use the proyectiles way, I use raycasts.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1

By ray duplication. Pseudo:

 

int i = 0;

startPos = raySpawn;

while(i < penetrationTimes)

{

if(ray(startPos, hit))

{

startPos = hit.pos;

i++;

continue;

}

break;

}

 

ofcourse each material is gonna have a penetration value but this is a basic example

  • Like 1

Share this post


Link to post
Share on other sites
  • 1

Also it could be interesting to take a look at this page about RaycastAll :

Please login or register to see this link.

However I prefer the way which OcularCash quoted because you can control time, setting delay between contact ++

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

have a look at this: Please login or register to see this link.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×