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
Sign in to follow this  
themars2011

How to make a spherecast into all directions ?

Question

Im trying to fix something on the zombie ai, but how can i make this spherecast into all directions ?

Please login or register to see this code.

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts


  • 0
Please login or register to see this quote.

 

Y? it will once make a spherecast into all directions

Share this post


Link to post
Share on other sites
  • 0

If you do one raycast per degree (probably a sensible ish amount of accuracy) for your sphere cast, that's still 360 times 360 rays which totals up to 129600 raycasts and they'd be all created at once, this would create massive performance drops

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

I am pretty sure than Spherecast raycasts in all directions already.

 

Please login or register to see this link.

 

 

Anyway, what are you using it for? Maybe there is a better solution

Share this post


Link to post
Share on other sites
  • 0

If you really want to do SphereCast (not recommended, since its slower, you could just compare distance instead), reduce the radius of the spherecast. You set the radius to 1 million meters so that will alert all zombies in the map and plus it's slower since the SphereCast has to sweep all colliders in the scene. If you lower to 100, then it will be a little bit faster and more realistic.

 

And why are you casting a Spherecast on the bullet? Why not on the player?

 

Here is an example of what you should do, I read the docs and saw that you did it all wrong:

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

bullet go is not the bullet lol, its where the bullet goes (actual now a raycast because i lost my bullet code and ive problems moving it into the right direction =( )

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.

Sign in to follow this  

×
×
  • Create New...