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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.


×
×
  • Create New...