Jump to content
  • Advertisement
Sign in to follow this  
CaseyHardman

Unity How conservative should I be with raycasts?

This topic is 2533 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been using UnityScript with Unity3D lately, and now I'm wondering if I should try to use raycasts sparingly. Are they difficult for the engine to perform? I have raycasts going on every frame, but I'm not having problems. However, there's not much else going on just yet with the project.

Should I try to limit how many raycasts I use per frame, or is this something I don't have to worry about? For example, what if I used a raycast for each bullet leaving your gun in an FPS, or used a raycast every frame to check if your mouse is targeting something in an RPG? Would this cause problems eventually?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
As with anything, you should build it the way you designed it, and worry about optimization if it becomes an issue. I'm not too sure with Unity, but I am sure that you probably aren't pushing it too hard.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!